Part Number Hot Search : 
GFC440 OP132W 5ETTT 74HCT583 74HCT583 MX66U512 ZX84C3 SMAJ3
Product Description
Full Text Search
 

To Download HD64F2266TF20 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hitachi 16-bit single-chip microcomputer h8s/2268 series, h8s/2264 series h8s/2268 hd6432268, hd6432268w, hd64f2268 h8s/2266 hd6432266, hd6432266w, hd64f2266 h8s/2265 hd6432265, hd6432265w, hd64f2265 h8s/2264 hd6432264, hd6432264w, hd64f2264 h8s/2264r hd6432264r, hd6432264rw, hd64f2264r h8s/2262 hd6432262, hd6432262w, h8s/2262r hd6432262r, hd6432262rw hardware manual ade-602-240a rev 2.0 09/17/02 hitachi, ltd.
rev. 2.0, 09/02, page ii of xl cautions 1. hitachi neither warrants nor grants licenses of any rights of hitachi?s or any third party?s patent, copyright, trademark, or other intellectual property rights for information contained in this document. hitachi bears no responsibility for problems that may arise with third party?s rights, including intellectual property rights, in connection with use of the information contained in this document. 2. products and product specifications may be subject to change without notice. confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. hitachi makes every attempt to ensure that its products are of high quality and reliability. however, contact hitachi?s sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. design your application so that the product is used within the ranges guaranteed by hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail-safes, so that the equipment incorporating hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the hitachi product. 5. this product is not designed to be radiation resistant. 6. no one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from hitachi. 7. contact hitachi?s sales office for any questions regarding this document or hitachi semiconductor products.
rev. 2.0, 09/02, page iii of xl general precautions on handling of product 1. treatment of nc pins note: do not connect anything to the nc pins. the nc (not connected) pins are either not connected to any of the internal circuitry or are used as test pins or to reduce noise. if something is connected to the nc pins, the operation of the lsi is not guaranteed. 2. treatment of unused input pins note: fix all unused input pins to high or low level. generally, the input pins of cmos products are high-impedance input pins. if unused pins are in their open states, intermediate levels are induced by noise in the vicinity, a pass- through current flows internally, and a malfunction may occur. 3. processing before initialization note: when power is first supplied, the product?s state is undefined. the states of internal circuits are undefined until full power is supplied throughout the chip and a low level is input on the reset pin. during the period where the states are undefined, the register settings and the output state of each pin are also undefined. design your system so that it does not malfunction because of processing while it is in this undefined state. for those products which have a reset function, reset the lsi immediately after the power supply has been turned on. 4. prohibition of access to undefined or reserved addresses note: access to undefined or reserved addresses is prohibited. the undefined or reserved addresses may be used to expand functions, or test registers may have been be allocated to these addresses. do not access these registers; the system?s operation is not guaranteed if they are accessed.
rev. 2.0, 09/02, page iv of xl configuration of this manual this manual comprises the following items: 1. general precautions on handling of product 2. configuration of this manual 3. preface 4. contents 5. overview 6. description of functional modules  cpu and system-control modules  on-chip peripheral modules the configuration of the functional description of each module differs according to the module. however, the generic style includes the following items: i) feature ii) input/output pin iii) register description iv) operation v) usage note when designing an application system that includes this lsi, take notes into account. each section includes notes in relation to the descriptions given, and usage notes are given, as required, as the final part of each section. 7. list of registers 8. electrical characteristics 9. appendix 10. main revisions and additions in this edition (only for revised versions) the list of revisions is a summary of points that have been revised or added to earlier versions. this does not include all of the revised contents. for details, see the actual locations in this manual. 11. index
rev. 2.0, 09/02, page v of xl preface this lsi is a high-performance microcontroller (mcu) made up of the h8s/2000 cpu with an internal 32-bit configuration as its core, and the peripheral functions required to configure a system. a single-power flash memory (f-ztat tm ) * version and a masked-rom version are available for this lsi's rom. the f-ztat version provides flexibility as it can be reprogrammed in no time to cope with all situations from the early stages of mass production to full-scale mass production. this is particularly applicable to application devices with specifications that will most probably change. list of on-chip peripheral functions: series name h8s/2268 series h8s/2264 series product name h8s/2268, 2266, 2265 h8s/2264, 2264r, 2262, 2262r pc break controller (pbc) x 2 ? data transfer controller (dtc) x 1 ? 16-bit timer pulse unit (tpu) x 3 x 2 8-bit timer (tmr_0 to tmr_3) x 4 x 2 8-bit reload timer (tmr_4) x 4 ? watch dog timer (wdt) x 2 x 2 serial communication interface (sci) x 3 x 3 i 2 c bus interface (iic) x 2 (option) x 1 (option) a/d converter x 10 x 10 d/a converter x 2 ? lcd controller/driver 40 seg/4 com 40 seg/4 com dtmf generation circuit x 1 ? power-on reset circuit ? x 1 ports 1, 3, 4, 7, 9, f, h, j to n 1, 3, 4, 7, 9, f, h, j to l external interrupts 14 13 interrupt priorities 8 levels ? notes: * f-ztat tm is a trademark of hitachi, ltd.
rev. 2.0, 09/02, page vi of xl target users: this manual was written for users who will be using the h8s/2268 series and h8s/2264 series in the design of application systems. target users are expected to understand the fundamentals of electrical circuits, logical circuits, and microcomputers. objective: this manual was written to explain the hardware functions and electrical characteristics of the h8s/2268 series and h8s/2264 series to the target users. refer to the h8s/2600 series, h8s/2000 series programming manual for a detailed description of the instruction set. notes on reading this manual: ? in order to understand the overall functions of the chip read the manual according to the contents. this manual can be roughly categorized into parts on the cpu, system control functions, peripheral functions and electrical characteristics. ? in order to understand the details of the cpu's functions read the h8s/2600 series, h8s/2000 series programming manual. ? in order to understand the details of a register when its name is known read the index that is the final part of the manual to find the page number of the entry on the register. the addresses, bits, and initial values of the registers are summarized in section 25, list of registers. examples: register name: the following notation is used for cases when the same or a similar function, e.g. 16-bit timer pulse unit or serial communication, is implemented on more than one channel: xxx_n (xxx is the register name and n is the channel number) bit order: the msb is on the left and the lsb is on the right. notes: 1. when using the on-chip emulator (e10t) for the h8s/2264 series program development and debugging, the following restrictions must be noted. ? the wdt timer stops counting while the on-chip emulation is in break mode. accordingly, after resuming from the break mode, the counter value may be invalid. ? the fwe (brk) pin is reserved for the e10t, and cannot be used. ? pins p77, p76, and p75 cannot be used. in order to use these pins, additional parts are required on the user board. ? when the e10t is used, the fwe (brk) pin is an input/output pin (open-drain in output mode), p75 and p76 are input pins, and p77 is an output pin. 2. the emulator (e6000) does not support the following functions. they are only supported by the on-chip emulator (e10t). ? power-on reset (h8s/2264 series) ? oscillation stabilization time shortened (h8s/2264r, 2262r)
rev. 2.0, 09/02, page vii of xl ? ph4/ , ph5 pin function (h8s/2264 series) ? selection of the input subclock source wdt_1, sub /4, or sub /60 (h8s/2264 series) ? selection of the segment driver in four bit units (h8s/2264 series) related manuals: the latest versions of all related manuals are available from our web site. please ensure you have the latest versions of all documents you require. http://www.hitachisemiconductor.com/ h8s/2268 series, h8s/2264 series manuals: manual title ade no. h8s/2268 series, h8s/2264 series hardware manual this manual h8s/2600 series, h8s/2000 series programming manual ade-602-083 user's manuals for development tools: manual title ade no. h8s, h8/300 series c/c++ compiler, assembler, optimized linkage editor user's manual ade-702-247 h8s, h8/300 series simulator/debugger user?s manual ade-702-282 h8s, h8/300 series hitachi embedded workshop, hitachi debugging interface tutorial ade-702-231 hitachi embedded workshop user's manual ade-702-201 application notes: manual title ade no. c/c++ compiler guide ade-702-189 f-ztat technical q & a ade-502-046
rev. 2.0, 09/02, page viii of xl
rev. 2.0, 09/02, page ix of xl contents section 1 overview........................................................................................... 1 1.1 features .................................................................................................................... .........1 1.2 internal block diagram.....................................................................................................3 1.3 pin arrangement ............................................................................................................. ..5 1.4 pin functions ............................................................................................................... .....7 section 2 cpu................................................................................................... 13 2.1 features .................................................................................................................... .........13 2.1.1 differences between h8s/2600 cpu and h8s/2000 cpu ..................................14 2.1.2 differences from h8/300 cpu.............................................................................15 2.1.3 differences from h8/300h cpu..........................................................................15 2.2 cpu operating modes ......................................................................................................16 2.2.1 normal mode.......................................................................................................16 2.2.2 advanced mode ...................................................................................................17 2.3 address space ............................................................................................................... ....20 2.4 register configuration...................................................................................................... 21 2.4.1 general registers .................................................................................................22 2.4.2 program counter (pc) .........................................................................................23 2.4.3 extended control register (exr) (h8s/2268 series only) ................................23 2.4.4 condition-code register (ccr) ..........................................................................24 2.4.5 initial values of cpu registers ...........................................................................25 2.5 data formats ................................................................................................................ .....26 2.5.1 general register data formats ............................................................................26 2.5.2 memory data formats .........................................................................................28 2.6 instruction set ............................................................................................................. ......29 2.6.1 table of instructions classified by function .......................................................30 2.6.2 basic instruction formats ....................................................................................39 2.7 addressing modes and effective address calculation .....................................................40 2.7.1 register direct ? rn.............................................................................................41 2.7.2 register indirect ? @ern ....................................................................................41 2.7.3 register indirect with displacement ? @(d:16, ern) or @(d:32, ern)..............41 2.7.4 register indirect with post-increment or pre-decrement ? @ern+ or @-ern .. 41 2.7.5 absolute address ? @aa:8, @aa:16, @aa:24, or @aa:32....................................41 2.7.6 immediate ? #xx:8, #xx:16, or #xx:32 .................................................................42 2.7.7 program-counter relative ? @(d:8, pc) or @(d:16, pc)....................................42 2.7.8 memory indirect ? @@aa:8 ................................................................................42 2.7.9 effective address calculation .............................................................................43 2.8 processing states........................................................................................................... ....46 2.9 usage notes ................................................................................................................. .....48
rev. 2.0, 09/02, page x of xl 2.9.1 tas instruction.................................................................................................... 48 2.9.2 stm/ldm instruction ......................................................................................... 48 2.9.3 bit manipulation instructions .............................................................................. 48 section 3 mcu operating modes .....................................................................49 3.1 operating mode selection ................................................................................................ 49 3.2 register description........................................................................................................ .. 49 3.2.1 mode control register (mdcr) ......................................................................... 50 3.3 operating mode .............................................................................................................. .. 50 3.4 pin functions in each operating mode ............................................................................ 50 3.5 address map ................................................................................................................. .... 51 section 4 exception handling ...........................................................................53 4.1 exception handling types and priority............................................................................ 53 4.2 exception sources and exception vector table ............................................................... 54 4.3 reset ....................................................................................................................... .......... 55 4.3.1 reset exception handling.................................................................................... 55 4.3.2 interrupts after reset............................................................................................ 56 4.3.3 state of on-chip peripheral modules after reset release................................... 56 4.4 traces (supported only by the h8s/2268 series) ............................................................. 57 4.5 interrupts.................................................................................................................. ......... 57 4.6 trap instruction............................................................................................................ ..... 58 4.7 stack status after exception handling.............................................................................. 59 4.8 usage note.................................................................................................................. ...... 59 section 5 interrupt controller............................................................................61 5.1 features.................................................................................................................... ......... 61 5.2 input/output pins ........................................................................................................... ... 64 5.3 register descriptions ....................................................................................................... .64 5.3.1 system control register (syscr) ...................................................................... 65 5.3.2 interrupt priority registers a to g, i to m, and o (ipra to iprg, ipri to iprm, ipro) (h8s/2268 series only)......................... 67 5.3.3 irq enable register (ier) .................................................................................. 68 5.3.4 irq sense control registers h and l (iscrh and iscrl) ............................... 69 5.3.5 irq status register (isr).................................................................................... 71 5.3.6 wakeup interrupt request register (iwpr)........................................................ 73 5.3.7 interrupt enable register 1 (ienr1) ................................................................... 73 5.4 interrupt sources........................................................................................................... .... 74 5.4.1 external interrupts ............................................................................................... 74 5.4.2 internal interrupts ................................................................................................ 77 5.4.3 interrupt exception handling vector table......................................................... 77 5.5 operation ................................................................................................................... ....... 82 5.5.1 interrupt control modes and interrupt operation................................................ 82
rev. 2.0, 09/02, page xi of xl 5.5.2 interrupt control mode 0 .....................................................................................85 5.5.3 interrupt control mode 2 (h8s/2268 series only)..............................................87 5.5.4 interrupt exception handling sequence ..............................................................88 5.5.5 interrupt response times ....................................................................................90 5.5.6 dtc activation by interrupt (h8s/2268 series only) ........................................91 5.6 usage notes ................................................................................................................. .....91 5.6.1 contention between interrupt generation and disabling.....................................91 5.6.2 instructions that disable interrupts ......................................................................92 5.6.3 when interrupts are disabled .............................................................................92 5.6.4 interrupts during execution of eepmov instruction..........................................92 section 6 pc break controller (pbc) .............................................................. 93 6.1 features .................................................................................................................... .........93 6.2 register descriptions ....................................................................................................... .94 6.2.1 break address register a (bara) .....................................................................94 6.2.2 break address register b (barb)......................................................................94 6.2.3 break control register a (bcra) ......................................................................95 6.2.4 break control register b (bcrb).......................................................................96 6.3 operation................................................................................................................... ........96 6.3.1 pc break interrupt due to instruction fetch .......................................................96 6.3.2 pc break interrupt due to data access...............................................................96 6.3.3 notes on pc break interrupt handling ................................................................97 6.3.4 operation in transitions to power-down modes ................................................97 6.3.5 when instruction execution is delayed by one state .........................................98 6.4 usage notes ................................................................................................................. .....99 6.4.1 module stop mode setting ..................................................................................99 6.4.2 pc break interrupts..............................................................................................99 6.4.3 cmfa and cmfb ...............................................................................................99 6.4.4 pc break interrupt when dtc is bus master......................................................99 6.4.5 pc break set for instruction fetch at address following bsr, jsr, jmp, trapa, rte, or rts instruction............................................99 6.4.6 i bit set by ldc, andc, orc, or xorc instruction .......................................99 6.4.7 pc break set for instruction fetch at address following bcc instruction..........100 6.4.8 pc break set for instruction fetch at branch destination address of bcc instruction............................................................................................................100 section 7 bus controller................................................................................... 101 7.1 basic timing ................................................................................................................ .....101 7.1.1 on-chip memory access timing (rom, ram) ................................................101 7.1.2 on-chip peripheral module access timing (h'fffdac to h'ffffbf) ...........102 7.1.3 on-chip peripheral module access timing (h'fffc30 to h'fffca3).............102 7.2 bus arbitration (h8s/2268 series only) ..........................................................................103 7.2.1 order of priority of the bus masters....................................................................103
rev. 2.0, 09/02, page xii of xl 7.2.2 bus transfer timing............................................................................................ 104 7.2.3 resets and the bus controller.............................................................................. 104 section 8 data transfer controller (dtc) ........................................................105 8.1 features.................................................................................................................... ......... 105 8.2 register descriptions ....................................................................................................... . 107 8.2.1 dtc mode register a (mra) ............................................................................ 107 8.2.2 dtc mode register b (mrb)............................................................................. 109 8.2.3 dtc source address register (sar).................................................................. 109 8.2.4 dtc destination address register (dar).......................................................... 109 8.2.5 dtc transfer count register a (cra) .............................................................. 110 8.2.6 dtc transfer count register b (crb)............................................................... 110 8.2.7 dtc enable register (dtcer) .......................................................................... 110 8.2.8 dtc vector register (dtvecr)........................................................................ 111 8.3 activation sources .......................................................................................................... .. 111 8.4 location of register information and dtc vector table ................................................ 112 8.5 operation ................................................................................................................... ....... 115 8.5.1 normal mode....................................................................................................... 116 8.5.2 repeat mode ........................................................................................................ 117 8.5.3 block transfer mode ........................................................................................... 118 8.5.4 chain transfer ..................................................................................................... 119 8.5.5 interrupts.............................................................................................................. 12 0 8.5.6 operation timing................................................................................................. 121 8.5.7 number of dtc execution states ....................................................................... 122 8.6 procedures for using dtc................................................................................................ 123 8.6.1 activation by interrupt......................................................................................... 123 8.6.2 activation by software ........................................................................................ 124 8.7 examples of use of the dtc ............................................................................................ 124 8.7.1 normal mode....................................................................................................... 124 8.7.2 software activation ............................................................................................. 125 8.8 usage notes ................................................................................................................. ..... 125 8.8.1 module stop mode setting .................................................................................. 125 8.8.2 on-chip ram ..................................................................................................... 126 8.8.3 dtce bit setting................................................................................................. 126 section 9 i/o ports.............................................................................................127 9.1 port 1...................................................................................................................... ........... 133 9.1.1 port 1 data direction register (p1ddr)............................................................. 133 9.1.2 port 1 data register (p1dr)................................................................................ 134 9.1.3 port 1 register (port1)...................................................................................... 134 9.1.4 pin functions ....................................................................................................... 135 9.2 port 3...................................................................................................................... ........... 138 9.2.1 port 3 data direction register (p3ddr)............................................................. 139
rev. 2.0, 09/02, page xiii of xl 9.2.2 port 3 data register (p3dr)................................................................................139 9.2.3 port 3 register (port3)......................................................................................140 9.2.4 port 3 open drain control register (p3odr).....................................................140 9.2.5 pin functions .......................................................................................................141 9.3 port 4...................................................................................................................... ...........144 9.3.1 port 4 register (port4)......................................................................................144 9.3.2 pin functions .......................................................................................................144 9.4 port 7...................................................................................................................... ...........145 9.4.1 port 7 data direction register (p7ddr).............................................................145 9.4.2 port 7 data register (p7dr)................................................................................145 9.4.3 port 7 register (port7)......................................................................................146 9.4.4 pin functions .......................................................................................................146 9.5 port 9...................................................................................................................... ...........148 9.5.1 port 9 register (port9)......................................................................................148 9.5.2 pin functions .......................................................................................................148 9.6 port f...................................................................................................................... ...........149 9.6.1 port f data direction register (pfddr) ............................................................149 9.6.2 port f data register (pfdr) ...............................................................................149 9.6.3 port f register (portf) .....................................................................................150 9.6.4 pin functions .......................................................................................................150 9.7 port h ...................................................................................................................... ..........150 9.7.1 port h data direction register (phddr) ...........................................................151 9.7.2 port h data register (phdr) ..............................................................................152 9.7.3 port h register (porth) ....................................................................................153 9.7.4 pin functions .......................................................................................................153 9.8 port j ...................................................................................................................... ...........156 9.8.1 port j data direction register (pjddr)..............................................................157 9.8.2 port j data register (pjdr).................................................................................157 9.8.3 port j register (portj).......................................................................................158 9.8.4 port j pull-up mos control register (pjpcr)...................................................158 9.8.5 wakeup control register (wpcr)......................................................................159 9.8.6 pin functions .......................................................................................................159 9.8.7 input pull-up mos function...............................................................................160 9.9 port k ...................................................................................................................... ..........161 9.9.1 port k data direction register (pkddr) ...........................................................161 9.9.2 port k data register (pkdr) ..............................................................................161 9.9.3 port k register (portk) ....................................................................................162 9.9.4 pin functions .......................................................................................................162 9.10 port l ..................................................................................................................... ...........163 9.10.1 port l data direction register (plddr) ............................................................163 9.10.2 port l data register (pldr)...............................................................................164 9.10.3 port l register (portl).....................................................................................164 9.10.4 pin functions .......................................................................................................165
rev. 2.0, 09/02, page xiv of xl 9.11 port m (h8s/2268 series only)........................................................................................ 166 9.11.1 port m data direction register (pmddr).......................................................... 166 9.11.2 port m data register (pmdr)............................................................................. 166 9.11.3 port m register (portm)................................................................................... 167 9.11.4 pin functions ....................................................................................................... 167 9.12 port n (h8s/2268 series only) ........................................................................................ 168 9.12.1 port n data direction register (pnddr) ........................................................... 168 9.12.2 port n data register (pndr).............................................................................. 168 9.12.3 port n register (portn) .................................................................................... 169 9.12.4 pin functions ....................................................................................................... 169 section 10 16-bit timer pulse unit (tpu) .......................................................171 10.1 features................................................................................................................... .......... 171 10.2 input/output pins .......................................................................................................... .... 176 10.3 register descriptions ...................................................................................................... .. 177 10.3.1 timer control register (tcr)............................................................................. 178 10.3.2 timer mode register (tmdr) ............................................................................ 182 10.3.3 timer i/o control register (tior) ..................................................................... 184 10.3.4 timer interrupt enable register (tier) .............................................................. 192 10.3.5 timer status register (tsr)................................................................................ 194 10.3.6 timer counter (tcnt)........................................................................................ 199 10.3.7 timer general register (tgr) ............................................................................ 199 10.3.8 timer start register (tstr)................................................................................ 199 10.3.9 timer synchro register (tsyr) ......................................................................... 201 10.4 interface to bus master .................................................................................................... . 202 10.4.1 16-bit registers ................................................................................................... 202 10.4.2 8-bit registers ..................................................................................................... 202 10.5 operation .................................................................................................................. ........ 203 10.5.1 basic functions.................................................................................................... 203 10.5.2 synchronous operation........................................................................................ 208 10.5.3 buffer operation (h8s/2268 series only)........................................................... 210 10.5.4 operation with cascaded connection (h8s/2264 series only) .......................... 213 10.5.5 pwm modes ........................................................................................................ 215 10.5.6 phase counting mode (h8s/2268 series only)................................................... 220 10.6 interrupt sources.......................................................................................................... ..... 225 10.7 dtc activation (h8s/2268 series only) ......................................................................... 226 10.8 a/d converter activation................................................................................................. 22 6 10.9 operation timing........................................................................................................... ... 227 10.9.1 input/output timing ............................................................................................ 227 10.9.2 interrupt signal timing ....................................................................................... 231 10.10 usage notes ............................................................................................................... ....... 234 10.10.1 module stop mode setting .................................................................................. 234 10.10.2 input clock restrictions ...................................................................................... 234
rev. 2.0, 09/02, page xv of xl 10.10.3 caution on period setting ....................................................................................235 10.10.4 contention between tcnt write and clear operations .....................................235 10.10.5 contention between tcnt write and increment operations..............................236 10.10.6 contention between tgr write and compare match .........................................236 10.10.7 contention between buffer register write and compare match (h8s/2268 series only) ......................................................................................237 10.10.8 contention between tgr read and input capture..............................................238 10.10.9 contention between tgr write and input capture.............................................238 10.10.10 contention between buffer register write and input capture (h8s/2268 series only)...................................................................................239 10.10.11 contention between overflow/underflow and counter clearing....................240 10.10.12 contention between tcnt write and overflow/underflow...........................241 10.10.13 multiplexing of i/o pins ..................................................................................241 10.10.14 interrupts in module stop mode ......................................................................241 section 11 8-bit timers .................................................................................... 243 11.1 8-bit timer module (tmr_0, tmr_1, tmr_2 and tmr_3).........................................243 11.1.1 features................................................................................................................2 43 11.2 input/output pins .......................................................................................................... ....245 11.3 register descriptions ...................................................................................................... ..245 11.3.1 timer counter (tcnt)........................................................................................246 11.3.2 time constant register a (tcora)...................................................................246 11.3.3 time constant register b (tcorb) ...................................................................246 11.3.4 timer control register (tcr) .............................................................................247 11.3.5 timer control/status register (tcsr) ................................................................249 11.4 operation.................................................................................................................. .........254 11.4.1 pulse output.........................................................................................................254 11.5 operation timing........................................................................................................... ...255 11.5.1 tcnt incrementation timing .............................................................................255 11.5.2 timing of cmfa and cmfb setting when a compare-match occurs..............255 11.5.3 timing of timer output when a compare-match occurs ..................................256 11.5.4 timing of compare-match clear when a compare-match occurs ....................256 11.5.5 tcnt external reset timing ..............................................................................257 11.5.6 timing of overflow flag (ovf) setting .............................................................257 11.6 operation with cascaded connection ...............................................................................258 11.6.1 16-bit count mode ..............................................................................................258 11.6.2 compare-match count mode ..............................................................................258 11.7 interrupt sources .......................................................................................................... .....259 11.7.1 interrupt sources and dtc activation ................................................................259 11.7.2 a/d converter activation....................................................................................259 11.8 usage notes ................................................................................................................ ......260 11.8.1 contention between tcnt write and clear........................................................260 11.8.2 contention between tcnt write and increment ................................................261
rev. 2.0, 09/02, page xvi of xl 11.8.3 contention between tcor write and compare-match ...................................... 262 11.8.4 contention between compare-matches a and b................................................. 262 11.8.5 switching of internal clocks and tcnt operation............................................. 263 11.8.6 contention between interrupts and module stop mode ...................................... 264 11.9 8-bit reload timer (tmr_4) (h8s/2268 series only).................................................... 265 11.9.1 features................................................................................................................ 2 65 11.9.2 input/output pins................................................................................................. 266 11.10 register descriptions ..................................................................................................... ... 267 11.10.1 timer control registers 4 to 7 (tcr_4 to tcr_7)............................................. 267 11.10.2 timer counters 4 to 7 (tcnt4 to tcnt7)......................................................... 268 11.10.3 time reload registers 4 to 7 (tlr_4 to tlr_7) ............................................... 268 11.11 operation ................................................................................................................. ......... 269 11.11.1 interval timer operation ..................................................................................... 269 11.11.2 automatic reload timer operation..................................................................... 270 11.11.3 cascaded connection........................................................................................... 270 11.12 usage notes ............................................................................................................... ....... 272 11.12.1 conflict between write to tlr and count up/automatic reload....................... 272 11.12.2 switchover of the internal clock and tcnt operation ...................................... 272 11.12.3 interrupt during module stop .............................................................................. 272 section 12 watchdog timer ..............................................................................273 12.1 features................................................................................................................... .......... 273 12.2 register descriptions ...................................................................................................... .. 275 12.2.1 timer counter (tcnt)........................................................................................ 275 12.2.2 timer control/status register (tcsr)................................................................ 276 12.2.3 reset control/status register (rstcsr) (only wdt_0) ................................... 280 12.3 operation .................................................................................................................. ........ 281 12.3.1 watchdog timer mode ........................................................................................ 281 12.3.2 interval timer mode............................................................................................ 282 12.3.3 timing of setting overflow flag (ovf) ............................................................. 283 12.3.4 timing of setting watchdog timer overflow flag (wovf) ............................. 284 12.4 interrupt sources.......................................................................................................... ..... 284 12.5 usage notes ................................................................................................................ ...... 285 12.5.1 notes on register access..................................................................................... 285 12.5.2 contention between timer counter (tcnt) write and increment ..................... 286 12.5.3 changing value of cks2 to cks0...................................................................... 286 12.5.4 switching between watchdog timer mode and interval timer mode................ 286 12.5.5 internal reset in watchdog timer mode............................................................. 286 12.5.6 ovf flag clearing in interval timer mode ........................................................ 287 section 13 serial communication interface (sci) ............................................289 13.1 features................................................................................................................... .......... 289 13.2 input/output pins .......................................................................................................... .... 293
rev. 2.0, 09/02, page xvii of xl 13.3 register descriptions ...................................................................................................... ..293 13.3.1 receive shift register (rsr)...............................................................................294 13.3.2 receive data register (rdr) ..............................................................................294 13.3.3 transmit data register (tdr).............................................................................294 13.3.4 transmit shift register (tsr) .............................................................................294 13.3.5 serial mode register (smr)................................................................................295 13.3.6 serial control register (scr)..............................................................................298 13.3.7 serial status register (ssr).................................................................................303 13.3.8 smart card mode register (scmr) ....................................................................310 13.3.9 bit rate register (brr) ......................................................................................311 13.3.10 serial expansion mode register (semr_0) .......................................................319 13.4 operation in asynchronous mode ....................................................................................323 13.4.1 data transfer format...........................................................................................323 13.4.2 receive data sampling timing and reception margin in asynchronous mode ........................................................................................325 13.4.3 clock.................................................................................................................... 326 13.4.4 sci initialization (asynchronous mode) .............................................................326 13.4.5 serial data transmission (asynchronous mode) ................................................327 13.4.6 serial data reception (asynchronous mode)......................................................330 13.5 multiprocessor communication function.........................................................................334 13.5.1 multiprocessor serial data transmission ............................................................335 13.5.2 multiprocessor serial data reception .................................................................337 13.6 operation in clocked synchronous mode ........................................................................340 13.6.1 clock.................................................................................................................... 340 13.6.2 sci initialization (clocked synchronous mode) .................................................340 13.6.3 serial data transmission (clocked synchronous mode) ....................................342 13.6.4 serial data reception (clocked synchronous mode)..........................................344 13.6.5 simultaneous serial data transmission and reception (clocked synchronous mode) .............................................................................346 13.7 operation in smart card interface ....................................................................................348 13.7.1 pin connection example......................................................................................348 13.7.2 data format (except for block transfer mode)..................................................348 13.7.3 block transfer mode ...........................................................................................350 13.7.4 receive data sampling timing and reception margin.......................................350 13.7.5 initialization .........................................................................................................35 1 13.7.6 serial data transmission (except for block transfer mode)..............................352 13.7.7 serial data reception (except for block transfer mode) ...................................355 13.7.8 clock output control...........................................................................................356 13.8 interrupt sources .......................................................................................................... .....358 13.8.1 interrupts in normal serial communication interface mode ..............................358 13.8.2 interrupts in smart card interface mode .............................................................360 13.9 usage notes ................................................................................................................ ......360 13.9.1 module stop mode setting ..................................................................................360
rev. 2.0, 09/02, page xviii of xl 13.9.2 break detection and processing (asynchronous mode only) .............................. 360 13.9.3 mark state and break detection (asynchronous mode only).............................. 361 13.9.4 receive error flags and transmit operations (clocked synchronous mode only) .................................................................... 361 13.9.5 restrictions on use of dtc (h8s/2268 series only).......................................... 361 13.9.6 operation in case of mode transition................................................................. 362 13.9.7 switching from sck pin function to port pin function: .................................... 365 13.9.8 assignment and selection of registers................................................................ 366 section 14 i 2 c bus interface (iic) (option) ......................................................367 14.1 features................................................................................................................... .......... 367 14.2 input/output pins .......................................................................................................... .... 370 14.3 register descriptions ...................................................................................................... .. 370 14.3.1 i 2 c bus data register (icdr) ............................................................................. 371 14.3.2 slave address register (sar)............................................................................. 373 14.3.3 second slave address register (sarx) ............................................................. 373 14.3.4 i 2 c bus mode register (icmr)........................................................................... 374 14.3.5 serial control register (scrx)........................................................................... 377 14.3.6 i 2 c bus control register (iccr)......................................................................... 378 14.3.7 i 2 c bus status register (icsr)............................................................................ 382 14.3.8 ddc switch register (ddcswr) ...................................................................... 385 14.4 operation .................................................................................................................. ........ 385 14.4.1 i 2 c bus data format ............................................................................................ 385 14.4.2 master transmit operation .................................................................................. 387 14.4.3 master receive operation.................................................................................... 388 14.4.4 slave receive operation...................................................................................... 391 14.4.5 slave transmit operation .................................................................................... 393 14.4.6 iric setting timing and scl control ................................................................ 396 14.4.7 operation using the dtc (h8s/2268 series only)............................................. 397 14.4.8 noise chancellor.................................................................................................. 398 14.4.9 sample flowcharts............................................................................................... 398 14.5 usage notes ................................................................................................................ ...... 403 section 15 a/d converter .................................................................................411 15.1 features................................................................................................................... .......... 411 15.2 input/output pins .......................................................................................................... .... 413 15.3 register descriptions ...................................................................................................... .. 414 15.3.1 a/d data registers a to d (addra to addrd) ............................................. 414 15.3.2 a/d control/status register (adcsr) ............................................................... 415 15.3.3 a/d control register (adcr) ............................................................................ 417 15.4 operation .................................................................................................................. ........ 418 15.4.1 single mode......................................................................................................... 418 15.4.2 scan mode ........................................................................................................... 419
rev. 2.0, 09/02, page xix of xl 15.4.3 input sampling and a/d conversion time .........................................................420 15.4.4 external trigger input timing.............................................................................422 15.5 interrupt source ........................................................................................................... .....422 15.6 a/d conversion accuracy definitions .............................................................................423 15.7 usage notes ................................................................................................................ ......425 15.7.1 module stop mode setting ..................................................................................425 15.7.2 permissible signal source impedance .................................................................425 15.7.3 influences on absolute accuracy ........................................................................425 15.7.4 range of analog power supply and other pin settings ......................................426 15.7.5 notes on board design ........................................................................................426 15.7.6 notes on noise countermeasures ........................................................................426 section 16 d/a converter................................................................................. 429 16.1 features ................................................................................................................... ..........429 16.2 input/output pins .......................................................................................................... ....430 16.3 register description....................................................................................................... ...430 16.3.1 d/a data registers 0 and 1 (dadr0 and dadr1)............................................430 16.3.2 d/a control register (dacr).............................................................................431 16.4 operation.................................................................................................................. .........432 16.5 usage notes ................................................................................................................ .......433 16.5.1 analog power supply current in software standby mode .................................433 16.5.2 setting for module stop mode.............................................................................433 section 17 lcd controller/driver.................................................................... 435 17.1 overview................................................................................................................... ........435 17.2 input/output pins .......................................................................................................... ....437 17.3 register descriptions ...................................................................................................... ..437 17.3.1 lcd port control register (lpcr).....................................................................438 17.3.2 lcd control register (lcr)...............................................................................441 17.3.3 lcd control register 2 (lcr2)..........................................................................442 17.4 operation.................................................................................................................. .........446 17.4.1 settings up to lcd display .................................................................................446 17.4.2 relationship between lcd ram and display ....................................................447 17.4.3 triple step-up voltage circuit (supported only by the h8s/2268 series) ........452 17.4.4 operation in power-down modes .......................................................................453 17.4.5 low-power lcd drive........................................................................................454 17.4.6 boosting the lcd drive power supply...............................................................455 section 18 dtmf generation circuit............................................................... 457 18.1 features ................................................................................................................... ..........457 18.2 input/output pins .......................................................................................................... ....458 18.3 register descriptions ...................................................................................................... ..458 18.3.1 dtmf control register (dtcr).........................................................................459
rev. 2.0, 09/02, page xx of xl 18.3.2 dtmf load register (dtlr)............................................................................. 460 18.4 operation .................................................................................................................. ........ 462 18.4.1 output waveform ................................................................................................ 462 18.4.2 operation flow .................................................................................................... 463 18.5 application circuit example ............................................................................................ 464 18.6 usage notes ................................................................................................................ ...... 464 section 19 ram ................................................................................................465 section 20 rom ................................................................................................467 20.1 features................................................................................................................... .......... 467 20.2 mode transitions ........................................................................................................... ... 468 20.3 block configuration........................................................................................................ .. 472 20.4 input/output pins .......................................................................................................... .... 476 20.5 register descriptions ...................................................................................................... .. 476 20.5.1 flash memory control register 1 (flmcr1)..................................................... 477 20.5.2 flash memory control register 2 (flmcr2)..................................................... 478 20.5.3 erase block register 1 (ebr1) ........................................................................... 478 20.5.4 erase block register 2 (ebr2) ........................................................................... 480 20.5.5 ram emulation register (ramer)................................................................... 480 20.5.6 flash memory power control register (flpwcr) ............................................ 482 20.5.7 serial control register x (scrx)....................................................................... 483 20.6 on-board programming modes........................................................................................ 484 20.6.1 boot mode ........................................................................................................... 484 20.6.2 programming/erasing in user program mode..................................................... 487 20.7 flash memory emulation in ram ................................................................................... 488 20.8 flash memory programming/erasing ............................................................................... 492 20.8.1 program/program-verify ..................................................................................... 492 20.8.2 erase/erase-verify............................................................................................... 494 20.8.3 interrupt handling when programming/erasing flash memory.......................... 494 20.9 program/erase protection ................................................................................................. 49 6 20.9.1 hardware protection ............................................................................................ 496 20.9.2 software protection.............................................................................................. 496 20.9.3 error protection.................................................................................................... 496 20.10 interrupt handling when programming/erasing flash memory....................................... 497 20.11 programmer mode ........................................................................................................... . 497 20.12 power-down states for flash memory............................................................................. 499 20.13 flash memory programming and erasing precautions..................................................... 500 20.14 note on switching from f-ztat version to masked rom version .............................. 505 section 21 clock pulse generator .....................................................................507 21.1 register descriptions ...................................................................................................... .. 509 21.1.1 system clock control register (sckcr) ........................................................... 509
rev. 2.0, 09/02, page xxi of xl 21.1.2 system clock control register 2 (sckcr2) (supported only by the h8s/2264 series)............................................................509 21.1.3 low-power control register (lpwrcr) ...........................................................512 21.2 system clock oscillator.................................................................................................... 514 21.2.1 connecting a crystal resonator...........................................................................514 21.2.2 connecting a ceramic resonator.........................................................................515 21.2.3 external clock input ............................................................................................516 21.2.4 notes on switching external clock .....................................................................517 21.3 duty adjustment circuit ...................................................................................................5 19 21.4 medium-speed clock divider ..........................................................................................519 21.5 bus master clock selection circuit ..................................................................................519 21.6 subclock oscillator ........................................................................................................ ...519 21.6.1 connecting 32.768khz crystal resonator ...........................................................519 21.6.2 handling pins when subclock not required ......................................................520 21.7 subclock waveform generation circuit ...........................................................................521 21.8 usage notes ................................................................................................................ ......521 21.8.1 note on crystal resonator ...................................................................................521 21.8.2 note on board design..........................................................................................521 21.8.3 note on using a crystal resonator (except for a ceramic resonator) ...............521 section 22 power-down modes ....................................................................... 523 22.1 register description....................................................................................................... ...526 22.1.1 standby control register (sbycr) ....................................................................527 22.1.2 module stop control registers a to d (mstpcra to mstpcrd) ..................529 22.2 medium-speed mode........................................................................................................53 1 22.3 sleep mode ................................................................................................................. ......532 22.3.1 sleep mode ..........................................................................................................532 22.3.2 exiting sleep mode..............................................................................................532 22.4 software standby mode....................................................................................................53 3 22.4.1 software standby mode.......................................................................................533 22.4.2 clearing software standby mode ........................................................................533 22.4.3 oscillation settling time after clearing software standby mode.......................534 22.4.4 software standby mode application example....................................................535 22.5 hardware standby mode ..................................................................................................536 22.5.1 hardware standby mode .....................................................................................536 22.5.2 clearing hardware standby mode.......................................................................536 22.5.3 hardware standby mode timing.........................................................................537 22.6 module stop mode........................................................................................................... .537 22.7 watch mode................................................................................................................. .....538 22.7.1 transition to watch mode ...................................................................................538 22.7.2 exiting watch mode ............................................................................................538 22.8 sub-sleep mode............................................................................................................. ...539 22.8.1 transition to sub-sleep mode .............................................................................539
rev. 2.0, 09/02, page xxii of xl 22.8.2 exiting sub-sleep mode ...................................................................................... 539 22.9 sub-active mode ............................................................................................................ .. 540 22.9.1 transition to sub-active mode ........................................................................... 540 22.9.2 exiting sub-active mode .................................................................................... 540 22.10 direct transitions........................................................................................................ ...... 541 22.10.1 direct transitions from high-speed mode to sub-active mode ........................ 541 22.10.2 direct transitions from sub-active mode to high-speed mode ........................ 541 22.11 usage notes ............................................................................................................... ....... 541 22.11.1 i/o port status...................................................................................................... 541 22.11.2 current dissipation during oscillation settling wait period............................... 541 22.11.3 dtc module stop (supported only by the h8s/2268 series) ............................. 541 22.11.4 on-chip peripheral module interrupt.................................................................. 542 22.11.5 writing to mstpcr ............................................................................................ 542 22.11.6 entering subactive / watch mode and dtc module stop (supported only by the h8s/2268 series)............................................................ 542 section 23 power-on reset circuit...................................................................543 23.1 features................................................................................................................... .......... 543 23.2 operation .................................................................................................................. ........ 543 23.2.1 power-on reset circuit ....................................................................................... 543 section 24 power supply circuit ......................................................................545 24.1 when the internal power step-down circuit is used .......................................................... 545 section 25 list of registers...............................................................................547 25.1 register addresses (by function module, in address order).............................................. 547 25.2 register bits.............................................................................................................. ........ 555 25.3 register states in each operating mode .......................................................................... 563 section 26 electrical characteristics .................................................................571 26.1 power supply voltage and operating frequency range.................................................. 571 26.2 electrical characteristics of the h8s/2268 series............................................................. 573 26.2.1 absolute maximum ratings ................................................................................ 573 26.2.2 dc characteristics ............................................................................................... 574 26.2.3 ac characteristics ............................................................................................... 589 26.2.4 a/d conversion characteristics........................................................................... 594 26.2.5 d/a conversion characteristics........................................................................... 595 26.2.6 lcd characteristics............................................................................................. 596 26.2.7 dtmf characteristics.......................................................................................... 598 26.2.8 flash memory characteristics ............................................................................. 599 26.3 electrical characteristics of the h8s/2264 series............................................................. 600 26.3.1 absolute maximum ratings ................................................................................ 600 26.3.2 dc characteristics ............................................................................................... 601
rev. 2.0, 09/02, page xxiii of xl 26.3.3 ac characteristics ...............................................................................................615 26.3.4 a/d conversion characteristics...........................................................................620 26.3.5 lcd characteristics.............................................................................................621 26.3.6 flash memory characteristics..............................................................................622 26.4 operation timing........................................................................................................... ...624 26.4.1 clock timing .......................................................................................................624 26.4.2 control signal timings........................................................................................625 26.4.3 timing of on-chip peripheral modules ..............................................................625 26.5 usage note................................................................................................................. .......627 appendix a i/o port states in each pin state.................................................. 629 a.1 i/o port state in each pin state of the h8s/2268 series ..................................................629 a.2 i/o port state in each pin state of the h8s/2264 series ..................................................630 appendix b product codes............................................................................... 632 appendix c package dimensions..................................................................... 642 main revisions and additions in this edition .................................................... 645 index ......................................................................................................... 655
rev. 2.0, 09/02, page xxiv of xl
rev. 2.0, 09/02, page xxv of xl figures section 1 overview figure 1.1 internal block diagram of h8s/2268 series .................................................................3 figure 1.2 internal block diagram of h8s/2264 series .................................................................4 figure 1.3 pin arrangement of h8s/2268 series............................................................................5 figure 1.4 pin arrangement of h8s/2264 series............................................................................6 section 2 cpu figure 2.1 exception vector table (normal mode).....................................................................17 figure 2.2 stack structure in normal mode .................................................................................17 figure 2.3 exception vector table (advanced mode).................................................................18 figure 2.4 stack structure in advanced mode .............................................................................19 figure 2.5 memory map........................................................................................................ .......20 figure 2.6 cpu registers ..................................................................................................... ........21 figure 2.7 usage of general registers ........................................................................................ .22 figure 2.8 stack status ...................................................................................................... ...........23 figure 2.9 general register data formats (1)..............................................................................26 figure 2.9 general register data formats (2)..............................................................................27 figure 2.10 memory data formats.............................................................................................. .28 figure 2.11 instruction formats (examples) ................................................................................40 figure 2.12 branch address specification in memory indirect mode .........................................43 figure 2.13 state transitions ................................................................................................ ........47 section 3 mcu operating modes figure 3.1 address map (1)................................................................................................... .......51 figure 3.2 address map (2)................................................................................................... .......52 section 4 exception handling figure 4.1 reset sequence (advanced mode with on-chip rom enabled)................................56 figure 4.2 stack status after exception handling (advanced mode) ..........................................59 figure 4.3 operation when sp value is odd................................................................................60 section 5 interrupt controller figure 5.1 block diagram of interrupt controller for h8s/2268 series.......................................62 figure 5.2 block diagram of interrupt controller for h8s/2264 series.......................................63 figure 5.3 block diagram of irqn interrupts ..............................................................................74 figure 5.4 set timing for irqnf .............................................................................................. ...75 figure 5.5 block diagram of interrupts wkp7 to wkp0 ............................................................76 figure 5.6 iwpfn setting timing .............................................................................................. ..76 figure 5.7 block diagram of interrupt control operation for h8s/2268 series..........................83 figure 5.8 block diagram of interrupt control operation for h8s/2264 series..........................83 figure 5.9 flowchart of procedure up to interrupt acceptance in interrupt control mode 0......86 figure 5.10 flowchart of procedure up to interrupt acceptance in control mode 2...................88
rev. 2.0, 09/02, page xxvi of xl figure 5.11 interrupt exception handling ....................................................................................8 9 figure 5.12 contention between interrupt generation and disabling ..........................................91 section 6 pc break controller (pbc) figure 6.1 block diagram of pc break controller.......................................................................94 figure 6.2 operation in power-down mode transitions..............................................................98 section 7 bus controller figure 7.1 on-chip memory access cycle................................................................................101 figure 7.2 on-chip peripheral module access cycle (h'fffdac to h'ffffbf) ...................102 figure 7.3 on-chip peripheral module access cycle (h'fffc30 to h'fffca3).....................103 section 8 data transfer controller (dtc) figure 8.1 block diagram of dtc .............................................................................................1 06 figure 8.2 block diagram of dtc activation source control ..................................................112 figure 8.3 the location of the dtc register information in the address space ......................113 figure 8.4 correspondence between dtc vector address and register information ...............113 figure 8.5 flowchart of dtc operation.....................................................................................116 figure 8.6 memory mapping in normal mode ..........................................................................117 figure 8.7 memory mapping in repeat mode ...........................................................................118 figure 8.8 memory mapping in block transfer mode...............................................................119 figure 8.9 chain transfer operation .......................................................................................... 120 figure 8.10 dtc operation timing (example in normal mode or repeat mode)....................121 figure 8.11 dtc operation timing (example of block transfer mode, with block size of 2) ......................................121 figure 8.12 dtc operation timing (example of chain transfer) ............................................122 section 9 i/o ports figure 9.1 types of open drain outputs....................................................................................141 section 10 16-bit timer pulse unit (tpu) figure 10.1 block diagram of tpu for h8s/2268 series ..........................................................174 figure 10.2 block diagram of tpu for h8s/2264 series ..........................................................175 figure 10.3 16-bit register access operation [ bus master ? tcnt (16 bits) ] ....................202 figure 10.4 8-bit register access operation [ bus master ? tcr (upper 8 bits) ] ................202 figure 10.5 8-bit register access operation [ bus master ? tmdr (lower 8 bits) ] ............203 figure 10.6 8-bit register access operation [ bus master ? tcr and tmdr (16 bits) ] ......203 figure 10.7 example of counter operation setting procedure ..................................................204 figure 10.8 free-running counter operation ............................................................................205 figure 10.9 periodic counter operation .....................................................................................20 5 figure 10.10 example of setting procedure for waveform output by compare match............206 figure 10.11 example of 0 output/1 output operation..............................................................206 figure 10.12 example of toggle output operation ...................................................................207 figure 10.13 example of input capture operation setting procedure .......................................207 figure 10.14 example of input capture operation.....................................................................208 figure 10.15 example of synchronous operation setting procedure.........................................209
rev. 2.0, 09/02, page xxvii of xl figure 10.16 example of synchronous operation......................................................................210 figure 10.17 compare match buffer operation .........................................................................211 figure 10.18 input capture buffer operation.............................................................................211 figure 10.19 example of buffer operation setting procedure...................................................211 figure 10.20 example of buffer operation (1)...........................................................................212 figure 10.21 example of buffer operation (2)...........................................................................213 figure 10.22 setting procedure for operation with cascaded operation...................................214 figure 10.23 example of operation with cascaded connection ................................................214 figure 10.24 example of pwm mode setting procedure ..........................................................216 figure 10.25 example of pwm mode operation (1) .................................................................217 figure 10.26 example of pwm mode operation (2) .................................................................218 figure 10.27 example of pwm mode operation (3) .................................................................219 figure 10.28 example of phase counting mode setting procedure...........................................220 figure 10.29 example of phase counting mode 1 operation ....................................................221 figure 10.30 example of phase counting mode 2 operation ....................................................222 figure 10.31 example of phase counting mode 3 operation ....................................................223 figure 10.32 example of phase counting mode 4 operation ....................................................224 figure 10.33 count timing in internal clock operation............................................................227 figure 10.34 count timing in external clock operation...........................................................227 figure 10.35 output compare output timing............................................................................228 figure 10.36 input capture input signal timing........................................................................228 figure 10.37 counter clear timing (compare match)...............................................................229 figure 10.38 counter clear timing (input capture) ..................................................................229 figure 10.39 buffer operation timing (compare match)..........................................................230 figure 10.40 buffer operation timing (input capture) .............................................................230 figure 10.41 tgi interrupt timing (compare match) ...............................................................231 figure 10.42 tgi interrupt timing (input capture) ...................................................................231 figure 10.43 tciv interrupt setting timing..............................................................................232 figure 10.44 tciu interrupt setting timing (h8s/2268 series only) ......................................232 figure 10.45 timing for status flag clearing by cpu ..............................................................233 figure 10.46 timing for status flag clearing by dtc activation (h8s/2268 series only) .....233 figure 10.47 phase difference, overlap, and pulse width in phase counting mode (h8s/2268 series only) ........................................................................................234 figure 10.48 contention between tcnt write and clear operations.......................................235 figure 10.49 contention between tcnt write and increment operations ...............................236 figure 10.50 contention between tgr write and compare match...........................................237 figure 10.51 contention between buffer register write and compare match ..........................237 figure 10.52 contention between tgr read and input capture ...............................................238 figure 10.53 contention between tgr write and input capture ..............................................239 figure 10.54 contention between buffer register write and input capture..............................239 figure 10.55 contention between overflow and counter clearing............................................240 figure 10.56 contention between tcnt write and overflow...................................................241
rev. 2.0, 09/02, page xxviii of xl section 11 8-bit timers figure 11.1 block diagram of 8-bit timer module ...................................................................244 figure 11.2 example of pulse output.........................................................................................2 54 figure 11.3 count timing for internal clock input....................................................................255 figure 11.4 count timing for external clock input...................................................................255 figure 11.5 timing of cmf setting ...........................................................................................2 56 figure 11.6 timing of timer output ..........................................................................................2 56 figure 11.7 timing of compare-match clear ............................................................................256 figure 11.8 timing of clearing by external reset input............................................................257 figure 11.9 timing of ovf setting............................................................................................ 257 figure 11.10 contention between tcnt write and clear .........................................................260 figure 11.11 contention between tcnt write and increment..................................................261 figure 11.12 contention between tcor write and compare-match........................................262 figure 11.13 block diagram of 8-bit reload timer ..................................................................266 figure 11.14 operation in interval timer mode.........................................................................269 figure 11.15 operation in automatic reload timer mode ........................................................270 figure 11.16 channel relationship of cascaded connection.....................................................271 section 12 watchdog timer figure 12.1 block diagram of wdt_0 ......................................................................................274 figure 12.2 block diagram of wdt_1 for h8s/2268 series.....................................................274 figure 12.3 block diagram of wdt_1 for h8s/2264 series.....................................................275 figure 12.4 watchdog timer mode operation...........................................................................282 figure 12.5 interval timer mode operation...............................................................................283 figure 12.6 timing of ovf setting............................................................................................ 283 figure 12.7 timing of wovf setting........................................................................................284 figure 12.8 writing to tcnt and tcsr (example for wdt_0)...............................................285 figure 12.9 contention between tcnt write and increment....................................................286 section 13 serial communication interface (sci) figure 13.1 block diagram of sci_0 .........................................................................................29 1 figure 13.2 block diagram of sci_1 or sci_2..........................................................................292 figure 13.3 example of the internal base clock when the average transfer rate is selected (1) ............................................................................................................................... ..321 figure 13.4 example of the internal base clock when the average transfer rate is selected (2) ............................................................................................................................... ..322 figure 13.5 data format in asynchronous communication (example with 8-bit data, parity, two stop bits) ..................................................323 figure 13.6 receive data sampling timing in asynchronous mode ........................................325 figure 13.7 relationship between output clock and transfer data phase (asynchronous mode) .............................................................................................326 figure 13.8 sample sci initialization flowchart .......................................................................327 figure 13.9 example of operation in transmission in asynchronous mode (example with 8-bit data, parity, one stop bit) ....................................................328
rev. 2.0, 09/02, page xxix of xl figure 13.10 sample serial transmission flowchart .................................................................329 figure 13.11 example of sci operation in reception (example with 8-bit data, parity, one stop bit) ..................................................330 figure 13.12 sample serial reception data flowchart (1) ........................................................332 figure 13.12 sample serial reception data flowchart (2) ........................................................333 figure 13.13 example of communication using multiprocessor format (transmission of data h'aa to receiving station a) ..........................................335 figure 13.14 sample multiprocessor serial transmission flowchart ........................................336 figure 13.15 example of sci operation in reception (example with 8-bit data, multiprocessor bit, one stop bit)..............................337 figure 13.16 sample multiprocessor serial reception flowchart (1)........................................338 figure 13.16 sample multiprocessor serial reception flowchart (2)........................................339 figure 13.17 data format in synchronous communication (for lsb-first).............................340 figure 13.18 sample sci initialization flowchart .....................................................................341 figure 13.19 sample sci transmission operation in clocked synchronous mode ..................342 figure 13.20 sample serial transmission flowchart .................................................................343 figure 13.21 example of sci operation in reception ...............................................................344 figure 13.22 sample serial reception flowchart.......................................................................345 figure 13.23 sample flowchart of simultaneous serial transmit and receive operations.......347 figure 13.24 schematic diagram of smart card interface pin connections..............................348 figure 13.25 normal smart card interface data format............................................................349 figure 13.26 direct convention (sdir = sinv = o/ e = 0) ......................................................349 figure 13.27 inverse convention (sdir = sinv = o/ e = 1).....................................................349 figure 13.28 receive data sampling timing in smart card mode (using clock of 372 times the transfer rate)......................................................351 figure 13.29 retransfer operation in sci transmit mode.........................................................353 figure 13.30 tend flag generation timing in transmission operation..................................353 figure 13.31 example of transmission processing flow...........................................................354 figure 13.32 retransfer operation in sci receive mode ..........................................................355 figure 13.33 example of reception processing flow ................................................................356 figure 13.34 timing for fixing clock output level..................................................................356 figure 13.35 clock halt and restart procedure .........................................................................357 figure 13.36 example of clocked synchronous transmission by dtc ....................................361 figure 13.37 sample flowchart for mode transition during transmission ...............................363 figure 13.38 asynchronous transmission using internal clock ...............................................363 figure 13.39 synchronous transmission using internal clock..................................................364 figure 13.40 sample flowchart for mode transition during reception ....................................364 figure 13.41 operation when switching from sck pin function to port pin function ............365 figure 13.42 operation when switching from sck pin function to port pin function (example of preventing low-level output).........................................................366 section 14 i 2 c bus interface (iic) (option) figure 14.1 block diagram of i 2 c bus interface........................................................................369
rev. 2.0, 09/02, page xxx of xl figure 14.2 i 2 c bus interface connections (example: this lsi as master) ..............................370 figure 14.3 i 2 c bus data formats (i 2 c bus formats)................................................................386 figure 14.4 i 2 c bus data format (serial format) ......................................................................386 figure 14.5 i 2 c bus timing........................................................................................................386 figure 14.6 master transmit mode operation timing example (mls = wait = 0) ...............388 figure 14.7 (1) master receive mode operation timing example (mls = ackb = 0, wait = 1) ........................................................................390 figure 14.7 (2) master receive mode operation timing example (mls = ackb = 0, wait = 1) ........................................................................390 figure 14.8 example of slave receive mode operation timing (1) (mls = ackb = 0) ........392 figure 14.9 example of slave receive mode operation timing (2) (mls = ackb = 0) ........393 figure 14.10 example of slave transmit mode operation timing (mls = 0)..........................395 figure 14.11 iric setting timing and scl control..................................................................396 figure 14.12 block diagram of noise chancellor......................................................................398 figure 14.13 sample flowchart for master transmit mode.......................................................399 figure 14.14 sample flowchart for master receive mode ........................................................400 figure 14.15 sample flowchart for slave receive mode ..........................................................401 figure 14.16 sample flowchart for slave transmit mode.........................................................402 figure 14.17 points for attention concerning reading of master receive data .......................406 figure 14.18 flowchart and timing of start condition instruction issuance for retransmission.................................................................................................408 figure 14.19 timing of stop condition issuance .......................................................................409 section 15 a/d converter figure 15.1 block diagram of a/d converter............................................................................412 figure 15.2 example of a/d converter operation (single mode, channel 1 selected) .............419 figure 15.3 example of a/d converter operation (scan mode, channels an0 to an2 selected)........................................................420 figure 15.4 a/d conversion timing ..........................................................................................42 1 figure 15.5 external trigger input timing ................................................................................422 figure 15.6 a/d conversion accuracy definitions (1) ..............................................................424 figure 15.7 a/d conversion accuracy definitions (2) ..............................................................424 figure 15.8 example of analog input circuit ............................................................................425 figure 15.9 example of analog input protection circuit ...........................................................427 figure 15.10 analog input pin equivalent circuit .....................................................................427
rev. 2.0, 09/02, page xxxi of xl section 16 d/a converter figure 16.1 block diagram of d/a converter............................................................................429 figure 16.2 d/a converter operation example .........................................................................433 section 17 lcd controller/driver figure 17.1 block diagram of lcd controller/driver...............................................................436 figure 17.2 a waveform 1/2 duty 1/2 vias .................................................................................444 figure 17.3 handling of lcd drive power supply when using 1/2 duty ................................446 figure 17.4 lcd ram map (1/4 duty) .....................................................................................447 figure 17.5 lcd ram map (1/3 duty) .....................................................................................448 figure 17.6 lcd ram map (1/2 duty) .....................................................................................448 figure 17.7 lcd ram map (static mode)................................................................................449 figure 17.8 output waveforms for each duty cycle (a waveform) ........................................450 figure 17.9 output waveforms for each duty cycle (b waveform) ........................................451 figure 17.10 connection when triple step-up voltage circuit used (supported only by the h8s/2268 series) ............................................................453 figure 17.11 example of low-power-consumption lcd drive operation ..............................455 figure 17.12 connection of external split-resistance ...............................................................456 section 18 dtmf generation circuit figure 18.1 dtmf frequencies................................................................................................. .457 figure 18.2 dtmf generation circuit diagram ........................................................................458 figure 18.3 toned pin output equivalent circuit...................................................................462 figure 18.4 toned pin output waveform (row or column group alone) ............................462 figure 18.5 example of ha16808ant connection ..................................................................464 section 20 rom figure 20.1 block diagram of flash memory............................................................................468 figure 20.2 flash memory state transitions..............................................................................469 figure 20.3 boot mode........................................................................................................ .......470 figure 20.4 user program mode (example)...............................................................................471 figure 20.5 flash memory block configuration (h8s/2268) ....................................................473 figure 20.6 flash memory block configuration (h8s/2266 and h8s/2265) ............................474 figure 20.7 flash memory block configuration (h8s/2264 and h8s/2264r)..........................475 figure 20.8 programming/erasing flowchart example in user program mode ........................487 figure 20.9 flowchart for flash memory emulation in ram ...................................................488 figure 20.10 example of ram overlap operation (h8s/2268 series) .....................................490 figure 20.11 example of ram overlap operation (h8s/2264 series) .....................................491 figure 20.12 program/program-verify flowchart......................................................................493 figure 20.13 erase/erase-verify flowchart ...............................................................................495 figure 20.14 socket adapter pin correspondence diagram ......................................................498 figure 20.15 power-on/off timing (boot mode)......................................................................502 figure 20.16 power-on/off timing (user program mode) .......................................................503
rev. 2.0, 09/02, page xxxii of xl figure 20.17 mode transition timing (example: boot mode user mode ? user program mode)............................504 section 21 clock pulse generator figure 21.1 block diagram of clock pulse generator (h8s/2268 series).................................507 figure 21.2 block diagram of clock pulse generator (h8s/2264 series).................................508 figure 21.3 connection of crystal resonator (example) ...........................................................514 figure 21.4 crystal resonator equivalent circuit ......................................................................515 figure 21.5 connection of ceramic resonator (example) .........................................................515 figure 21.6 external clock input (examples) ............................................................................516 figure 21.7 external clock input timing...................................................................................517 figure 21.8 external clock switching circuit (examples).........................................................518 figure 21.9 external clock switching timing (examples)........................................................518 figure 21.10 example connection of 32.768khz quartz oscillator ..........................................519 figure 21.11 equivalence circuit for 32.768khz oscillator ......................................................520 figure 21.12 pin handling when subclock not required .........................................................520 figure 21.13 note on board design of oscillator circuit ..........................................................521 section 22 power-down modes figure 22.1 mode transition diagram .......................................................................................525 figure 22.2 medium-speed mode transition and clearance timing.........................................532 figure 22.3 software standby mode application example .......................................................536 figure 22.4 hardware standby mode timing ............................................................................537 section 23 power-on reset circuit figure 23.1 power-on reset circuit........................................................................................... 543 figure 23.2 power-on reset circuit operation timing .............................................................544 section 24 power supply circuit figure 24.1 power supply connections when an internal power supply step-down circuit is used.........................................................................................................................54 5 section 26 electrical characteristics figure 26.1 power supply voltage and operating ranges (1) ...................................................571 figure 26.1 power supply voltage and operating ranges (2) ...................................................572 figure 26.2 output load circuit.............................................................................................. ...589 figure 26.3 output load circuit.............................................................................................. ...615 figure 26.4 output clock timing.............................................................................................. .624 figure 26.5 oscillator settling timing ....................................................................................... 624 figure 26.6 reset input timing ............................................................................................... ...625 figure 26.7 interrupt input timing........................................................................................... ..625 figure 26.8 tpu clock input timing.........................................................................................62 5 figure 26.9 8-bit timer clock input timing..............................................................................626 figure 26.10 sck clock input timing.......................................................................................626 figure 26.11 sci input/output timing (clock synchronous mode) .........................................626 figure 26.12 i 2 c bus interface input/output timing (option)...................................................627
rev. 2.0, 09/02, page xxxiii of xl figure 26.13 toned load circuit (supported only by the h8s/2268 series)..........................627 appendix c package dimensions figure c.1 tfp-100b package dimensions ...............................................................................642 figure c.2 tfp-100g package dimensions ...............................................................................643 figure c.3 fp-100b package dimensions..................................................................................644
rev. 2.0, 09/02, page xxxiv of xl
rev. 2.0, 09/02, page xxxv of xl tables section 1 overview table 1.1 pin functions ......................................................................................................... .......7 section 2 cpu table 2.1 instruction classification ............................................................................................ 29 table 2.2 operation notation.................................................................................................... ..30 table 2.3 data transfer instructions...........................................................................................3 1 table 2.4 arithmetic operations instructions (1) .......................................................................32 table 2.4 arithmetic operations instructions (2) .......................................................................33 table 2.5 logic operations instructions.....................................................................................34 table 2.6 shift instructions.................................................................................................... .....34 table 2.7 bit manipulation instructions (1)................................................................................35 table 2.7 bit manipulation instructions (2)................................................................................36 table 2.8 branch instructions ................................................................................................... ..37 table 2.9 system control instructions........................................................................................38 table 2.10 block data transfer instructions ............................................................................39 table 2.11 addressing modes ..................................................................................................40 table 2.12 absolute address access ranges ...........................................................................42 table 2.13 effective address calculation (1)...........................................................................44 table 2.13 effective address calculation (2)...........................................................................45 section 3 mcu operating modes table 3.1 mcu operating mode selection ................................................................................49 section 4 exception handling table 4.1 exception types and priority......................................................................................53 table 4.2 exception handling vector table...............................................................................54 table 4.3 status of ccr and exr after trace exception handling...........................................57 table 4.4 status of ccr and exr* after trap instruction exception handling........................58 section 5 interrupt controller table 5.1 pin configuration..................................................................................................... ...64 table 5.2 interrupt sources, vector addresses, and interrupt priorities.....................................78 table 5.3 interrupt control modes .............................................................................................82 table 5.4 interrupts selected in each interrupt control mode (1) .............................................84 table 5.5 interrupts selected in each interrupt control mode (2) .............................................84 table 5.6 operations and control signal functions in each interrupt control mode ................85 table 5.7 interrupt response times (states) ..............................................................................90 table 5.8 number of states in interrupt handling routine execution status ............................90
rev. 2.0, 09/02, page xxxvi of xl section 8 data transfer controller (dtc) table 8.1 interrupt sources, dtc vector addresses, and corresponding dtces...................114 table 8.2 register information in normal mode......................................................................117 table 8.3 register information in repeat mode.......................................................................118 table 8.4 register information in block transfer mode..........................................................119 table 8.5 dtc execution status...............................................................................................122 table 8.6 number of states required for each execution status.............................................123 section 9 i/o ports table 9.1 h8s/2268 series port functions (1)..........................................................................128 table 9.1 h8s/2264 series port functions (2)..........................................................................131 table 9.2 input pull-up mos states (port j) ...........................................................................160 section 10 16-bit timer pulse unit (tpu) table 10.1 tpu functions ......................................................................................................17 2 table 10.2 tpu pins ............................................................................................................. ..176 table 10.3 cclr0 to cclr2 (channel 0) (h8s/2268 series only) ......................................179 table 10.4 cclr0 to cclr2 (channels 1 and 2) ..................................................................179 table 10.5 tpsc0 to tpsc2 (channel 0) (h8s/2268 series only) ........................................180 table 10.6 tpsc0 to tpsc2 (channel 1) ...............................................................................180 table 10.7 tpsc0 to tpsc2 (channels 2)..............................................................................181 table 10.8 md0 to md3 ........................................................................................................183 table 10.9 tiorh_0 (channel 0) (h8s/2268 series only) ...................................................185 table 10.10 tiorl_0 (channel 0) (h8s/2268 series only) ...................................................186 table 10.11 tior_1 (channel 1) .............................................................................................187 table 10.12 tior_2 (channel 2) .............................................................................................188 table 10.13 tiorh_0 (channel 0) (h8s/2268 series only) ...................................................189 table 10.14 tiorl_0 (channel 0) (h8s/2268 series only) ...................................................190 table 10.15 tior_1 (channel 1) .............................................................................................191 table 10.16 tior_2 (channel 2) .............................................................................................192 table 10.17 register combinations in buffer operation..........................................................210 table 10.18 counter combination in operation with cascaded connection ...........................213 table 10.19 pwm output registers and output pins...............................................................216 table 10.20 phase counting mode clock input pins ...............................................................220 table 10.21 up/down-count conditions in phase counting mode 1......................................221 table 10.22 up/down-count conditions in phase counting mode 2......................................222 table 10.23 up/down-count conditions in phase counting mode 3......................................223 table 10.24 up/down-count conditions in phase counting mode 4......................................224 table 10.25 tpu interrupts ...................................................................................................... 225 section 11 8-bit timers table 11.1 pin configuration..................................................................................................24 5 table 11.2 8-bit timer interrupt sources ...............................................................................259
rev. 2.0, 09/02, page xxxvii of xl table 11.3 timer output priorities .........................................................................................262 table 11.4 switching of internal clock and tcnt operation ...............................................263 section 12 watchdog timer table 12.1 clock selection when pss = 1.............................................................................279 table 12.2 wdt interrupt source ..........................................................................................284 section 13 serial communication interface (sci) table 13.1 pin configuration..................................................................................................29 3 table 13.2 the relationships between the n setting in brr and bit rate b.......................311 table 13.3 brr settings for various bit rates (asynchronous mode) (1) ...........................312 table 13.3 brr settings for various bit rates (asynchronous mode) (2) ...........................313 table 13.3 brr settings for various bit rates (asynchronous mode) (3) ...........................314 table 13.3 brr settings for various bit rates (asynchronous mode) (4) ...........................315 table 13.4 maximum bit rate for each frequency (asynchronous mode)...........................315 table 13.5 maximum bit rate with external clock input (asynchronous mode).................316 table 13.6 brr settings for various bit rates (clocked synchronous mode).....................317 table 13.7 maximum bit rate with external clock input (clocked synchronous mode) ....317 table 13.8 examples of bit rate for various brr settings (smart card interface mode) (when n = 0 and s = 372)......................................318 table 13.9 maximum bit rate at various frequencies (smart card interface mode) (when s = 372) ......................................................318 table 13.10 serial transfer formats (asynchronous mode)....................................................324 table 13.11 ssr status flags and receive data handling ......................................................331 table 13.12 interrupt sources of serial communication interface mode ................................359 table 13.13 interrupt sources in smart card interface mode ..................................................360 section 14 i 2 c bus interface (iic) (option) table 14.1 pin configuration..................................................................................................37 0 table 14.2 transfer format ....................................................................................................37 4 table 14.3 i 2 c transfer rate ..................................................................................................376 table 14.4 flags and transfer states ......................................................................................382 table 14.5 flags and transfer states ......................................................................................397 table 14.6 i 2 c bus timing (scl and sda output)...............................................................403 table 14.7 permissible scl rise time (t sr ) values................................................................404 table 14.8 i 2 c bus timing (with maximum influence of t sr /t sf )............................................405 section 15 a/d converter table 15.1 pin configuration..................................................................................................41 3 table 15.2 analog input channels and corresponding addr registers ..............................414 table 15.3 a/d conversion time (single mode)...................................................................421 table 15.4 a/d conversion time (scan mode) .....................................................................421 table 15.5 a/d converter interrupt source............................................................................422
rev. 2.0, 09/02, page xxxviii of xl table 15.6 analog pin specifications.....................................................................................427 section 16 d/a converter table 16.1 pin configuration..................................................................................................43 0 table 16.2 d/a conversion control .......................................................................................432 section 17 lcd controller/driver table 17.1 pin configuration..................................................................................................43 7 table 17.2 duty cycle and common function selection.......................................................439 table 17.3 segment driver selection (1) (h8s/2268 series) .................................................439 table 17.4 segment driver selection (2) (h8s/2264 series) .................................................440 table 17.5 frame frequency selection...................................................................................442 table 17.6 output levels........................................................................................................ 452 table 17.7 power-down modes and display operation ........................................................454 section 18 dtmf generation circuit table 18.1 pin configuration..................................................................................................45 8 table 18.2 frequency deviation between dtmf output signals and typical signals........463 section 20 rom table 20.1 differences between boot mode and user program mode ..................................469 table 20.2 pin configuration..................................................................................................47 6 table 20.3 setting on-board programming modes................................................................484 table 20.4 boot mode operation ...........................................................................................486 table 20.5 system clock frequencies for which automatic adjustment of lsi bit rate is possible .................................................................................................................486 table 20.6 flash memory operating states............................................................................499 table 20.7 registers present in f-ztat version but absent in masked rom version .......505 section 21 clock pulse generator table 21.1 clock output control.........................................................................................510 table 21.2 clock selection ..................................................................................................511 table 21.3 damping resistance value ...................................................................................515 table 21.4 crystal resonator characteristics .........................................................................515 table 21.5 external clock input conditions...........................................................................516 table 21.6 external clock input conditions (duty adjustment circuit not used) .................517 section 22 power-down modes table 22.1 lsi internal states in each mode .........................................................................523 table 22.2 low power dissipation mode transition conditions...........................................526 table 22.3 oscillation settling time settings (normal oscillation) ......................................534 table 22.4 oscillation settling time settings (oscillation settling time shortened: crystal oscillator) ....................................535
rev. 2.0, 09/02, page xxxix of xl table 22.5 oscillation settling time settings (oscillation settling time shortened: ceramic oscillator) ..................................535 section 26 electrical characteristics table 26.1 absolute maximum ratings .................................................................................573 table 26.2 dc characteristics (1)...........................................................................................574 table 26.2 dc characteristics (2)...........................................................................................576 table 26.2 dc characteristics (3)...........................................................................................578 table 26.2 dc characteristics (4)...........................................................................................580 table 26.2 dc characteristics (5)...........................................................................................582 table 26.2 dc characteristics (6) ? preliminary ? ............................................................584 table 26.3 permissible output currents .................................................................................586 table 26.4 bus drive characteristics (1)................................................................................587 table 26.4 bus drive characteristics (2)................................................................................588 table 26.5 clock timing ........................................................................................................5 90 table 26.6 control signal timing ..........................................................................................591 table 26.7 timing of on-chip peripheral modules ...............................................................592 table 26.8 i 2 c bus timing .....................................................................................................593 table 26.9 a/d conversion characteristics............................................................................594 table 26.10 d/a conversion characteristics............................................................................595 table 26.11 lcd characteristics..............................................................................................596 table 26.12 dtmf characteristics...........................................................................................598 table 26.13 flash memory characteristics...............................................................................599 table 26.14 absolute maximum ratings .................................................................................600 table 26.15 dc characteristics (1) ? preliminary ? .............................................................601 table 26.15 dc characteristics (2) ? preliminary ? .............................................................603 table 26.15 dc characteristics (3) ? preliminary ? .............................................................605 table 26.15 dc characteristics (4) ? preliminary ? .............................................................607 table 26.15 dc characteristics (5) ? preliminary ? .............................................................609 table 26.15 dc characteristics (6) ? preliminary ? .............................................................611 table 26.16 permissible output currents .................................................................................613 table 26.17 bus drive characteristics (1)................................................................................614 table 26.17 bus drive characteristics (2)................................................................................615 table 26.18 clock timing ? preliminary ?...........................................................................616 table 26.19 control signal timing ..........................................................................................617 table 26.20 timing of on-chip peripheral modules ...............................................................618 table 26.21 i 2 c bus timing .....................................................................................................619 table 26.22 a/d conversion characteristics ? preliminary ? ..............................................620 table 26.23 lcd characteristics..............................................................................................621 table 26.24 flash memory characteristics ? preliminary ? .................................................622
rev. 2.0, 09/02, page xl of xl
rev. 2.0, 09/02, page 1 of 658 section 1 overview 1.1 features ? high-speed h8s/2000 central processing unit with an internal 16-bit architecture ? upward-compatible with h8/300 and h8/300h cpus on an object level ? sixteen 16-bit general registers ? 65 basic instructions ? various peripheral functions ? interrupt controller ? pc break controller (supported only by the h8s/2268 series) ? data transfer controller (dtc) (supported only by the h8s/2268 series) ? 16-bit timer-pulse unit (tpu) ? 8-bit timer (tmr) ? watchdog timer (wdt) ? serial communication interface (sci) ? i 2 c bus interface (option) ? a/d converter ? d/a converter (supported only by the h8s/2268 series) ? lcd controller/driver ? dtmf generation circuit (supported only by the h8s/2268 series) ? on-chip memory h8s/2268 series: rom model rom ram remarks hd64f2268 256 kbytes 16 kbytes hd64f2266 128 kbytes 8 kbytes flash memory version hd64f2265 128 kbytes 4 kbytes hd6432268 256 kbytes 16 kbytes hd6432268w 256 kbytes 16 kbytes hd6432266 128 kbytes 8 kbytes hd6432266w 128 kbytes 8 kbytes hd6432265 128 kbytes 4 kbytes masked rom version hd6432265w 128 kbytes 4 kbytes
rev. 2.0, 09/02, page 2 of 658 h8s/2264 series: rom model rom ram remarks hd64f2264 128 kbytes 4 kbytes flash memory version hd64f2264r 128 kbytes 4 kbytes hd6432264 128 kbytes 4 kbytes hd6432264w 128 kbytes 4 kbytes hd6432264r 128 kbytes 4 kbytes hd6432264rw 128 kbytes 4 kbytes hd6432262 64 kbytes 2 kbytes hd6432262w 64 kbytes 2 kbytes hd6432262r 64 kbytes 2 kbytes masked rom version hd6432262rw 64 kbytes 2 kbytes ? general i/o ports ? i/o pins: 67 (supported only by the h8s/2268 series) 53 (supported only by the h8s/2264 series) ? input-only pins: 11 ? supports various power-down states ? compact package package (code) body size pin pitch tqfp-100 tfp-100b 14.0 14.0 mm 0.5 mm tqfp-100 tfp-100g 12.0 12.0 mm 0.4 mm qfp-100 fp-100b 14.0 14.0 mm 0.5 mm
rev. 2.0, 09/02, page 3 of 658 1.2 internal block diagram figure 1.1 shows the internal block diagram of the h8s/2268 series and figure 1.2 shows that of the h8s/2264 series. internal data bus cvcc v cc v ss v ss v1 v 2 v3 c1 c2 vref avcc avss rom pc break controller (2 channels) ram tpu (3 channels) md2 md1 extal xtal osc1 osc2 nmi fwe h8s/2000 cpu dtc interrupt controller pn7 /seg40 pn6 /seg39 pn5 /seg38 pn4 /seg37 pn3 /seg36 pn2 /seg35 pn1 /seg34 pn0 /seg33 port n p47 /an7 p46 /an6 p45 /an5 p44 /an4 p43 /an3 p42 /an2 p41 /an1 p40 /an0 port 4 p10 /tioca0 p11 /tiocb0 p12 /tiocc0 /tclka p13 /tiocd0 /tclkb p14 /tioca1/ p15 /tiocb1 /tclkc p16 /tioca2/ p17 /tiocb2/tclkd port 1 p96/an8/da0 p97/an9/da1 port 9 internal address bus pl7 / seg24 pl6 / seg23 pl5 / seg22 pl4 /seg21 pl3 / seg20 pl2 / seg19 pl1 / seg18 pl0 / seg17 pk7 / seg16 pk6 / seg15 pk5 / seg14 pk4 /seg13 pk3 / seg12 pk2 / seg11 pk1 / seg10 pk0 / seg9 pj7 / /seg8 pj6 / /seg7 pj5 / /seg6 pj4 / /seg5 pj3 / /seg4 pj2 / /seg3 pj1 / /seg2 pj0 / /seg1 pm7 / seg32 pm6 / seg31 pm5 / seg30 pm4 /seg29 pm3 / seg28 pm2 / seg27 pm1 / seg26 pm0 / seg25 ph7/toned/tmci4 ph3/com4 ph2/com3 ph1/com2 ph0/com1 pf3/ / p35/sck1/scl0/ p34/rxd1/sda0 p33/txd1/scl1 p32/sck0/sda1/ p31/rxd0 p30/txd0 p70/tmri01/tmci01 p71/tmri23/tmci23 p72/tmo0 p73/tmo1 p74/tmo2 p75/tmo3/sck2 p76/rxd2 p77/txd2 port 7 port 3 port f lcd (40seg/4com) iic (2 channels) (option) sci (3 channels) a/d converter(10 channels) 8 bit timer (4 channels+4 channels) d/a converter(2 channels) wdt0 wdt1 (sub clock) sub clock pulse generator system clock pulse generator dtmf peripheral data bus peripheral address bus port h port j port k port l port m bus controller figure 1.1 internal block diagram of h8s/2268 series
rev. 2.0, 09/02, page 4 of 658 internal data bus cvcc vcc vss vss v1 v2 v3 vref avcc avss rom ram tpu (2 channels) md2 md1 extal xtal osc1 osc2 nmi fwe h8s/2000 cpu interrupt controller seg40 seg39 seg38 seg37 seg36 seg35 seg34 seg33 p47 / an7 p46 / an6 p45 / an5 p44 / an4 p43 / an3 p42 / an2 p41 / an1 p40 / an0 port 4 p10 p11 p12 / tclka p13 / tclkb p14 / tioca1/ p15 / tiocb1 / tclkc p16 / tioca2/ p17 / tiocb2 port 1 p96/an8 p97/an9 port 9 internal address bus pl7 / seg24 pl6 / seg23 pl5 / seg22 pl4 /seg21 pl3 / seg20 pl2 / seg19 pl1 / seg18 pl0 / seg17 pk7 / seg16 pk6 / seg15 pk5 / seg14 pk4 /seg13 pk3 / seg12 pk2 / seg11 pk1 / seg10 pk0 / seg9 pj7 / /seg8 pj6 / /seg7 pj5 / /seg6 pj4 / /seg5 pj3 / /seg4 pj2 / /seg3 pj1 / /seg2 pj0 / /seg1 seg32 seg31 seg30 seg29 seg28 seg27 seg26 seg25 ph7 ph5 ph4/ ph3/com4 ph2/com3 ph1/com2 ph0/com1 pf3/ / p35/sck1/scl0 p34/rxd1/sda0 p33/txd1 p32/sck0/ p31/rxd0 p30/txd0 p70/tmri01/tmci01 p7 1 p72/tmo0 p73/tmo1 p74 p75/sck2 p76/rxd2 p77/txd2 port 7 port 3 port f lcd (40seg/4com) iic (1 channel) (option) sci (3 channels) a/d converter(10 channels) 8 bit timer (2 channels) wdt0 wdt1 (sub clock) sub clock pulse generator system clock pulse generator peripheral data bus peripheral address bus port h port j port k port l bus controller figure 1.2 internal block diagram of h8s/2264 series
rev. 2.0, 09/02, page 5 of 658 1.3 pin arrangement figure 1.3 shows the pin arrangement of the h8s/2268 series and figure 1.4 shows that of the h8s/2264 series. p30/txd0 p31/rxd0 p32/sck0/sda1/ p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ pf3/ / c2 c1 v3 v2 v1 ph3/com4 ph2/com3 ph1/com2 ph0/com1 pn7/seg40 pn6/seg39 pn5/seg38 pn4/seg37 pn3/seg36 pn2/seg35 pn1/seg34 pn0/seg33 pm7/seg32 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 p70/tmri01/tmci01 p71/tmri23/tmci23 p72/tmo0 p73/tmo1 p74/tmo2 p75/tmo3/sck2 p76/rxd2 p77/txd2 md2 fwe extal vss xtal vcc nmi osc1 osc2 md1 ph7/toned/tmci4 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/an8/da0 p97/an9/da1 p17/tiocb2/tclkd p16/tioca2/ p14/tioca1/ p13/tiocd0/tclkb p12/tiocc0/tclka p11/tiocb0 p10/tioca0 pj0/ /seg1 pj1/ /seg2 pj2/ /seg3 pj3/ /seg4 pj4/ /seg5 pj5/ /seg6 pj6/ /seg7 pj7/ /seg8 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pm6/seg31 pm5/seg30 pm4/seg29 pm3/seg28 pm2/seg27 pm1/seg26 pm0/seg25 pl7/seg24 pl6/seg23 pl5/seg22 pl4/seg21 pl2/seg19 pl1/seg18 pl0/seg17 pk7/seg16 pk6/seg15 pk5/seg14 pk4/seg13 pk3/seg12 pk1/seg10 pk0/seg9 cvcc pl3/seg20 vss pk2/seg11 fp-100b tfp-100b tfp-100g (top view) figure 1.3 pin arrangement of h8s/2268 series
rev. 2.0, 09/02, page 6 of 658 p30/txd0 p31/rxd0 p32/sck0/ p33/txd1 p34/rxd1/sda0 p35/sck1/scl0 pf3/ / ph5 ph4/ v3 v2 v1 ph3/com4 ph2/com3 ph1/com2 ph0/com1 seg40 seg39 seg38 seg37 seg36 seg35 seg34 seg33 seg32 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 p70/tmri01/tmci01 p71 p72/tmo0 p73/tmo1 p74 p75/sck2 p76/rxd2 p77/txd2 md2 fwe extal vss xtal vcc nmi osc1 osc2 md1 ph7 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/an8 p97/an9 p17/tiocb2 p16/tioca2/ p14/tioca1/ p13/tclkb p12/tclka p11 p10 pj0/ /seg1 pj1/ /seg2 pj2/ /seg3 pj3/ /seg4 pj4/ /seg5 pj5/ /seg6 pj6/ /seg7 pj7/ /seg8 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 seg31 seg30 seg29 seg28 seg27 seg26 seg25 pl7/seg24 pl6/seg23 pl5/seg22 pl4/seg21 pl2/seg19 pl1/seg18 pl0/seg17 pk7/seg16 pk6/seg15 pk5/seg14 pk4/seg13 pk3/seg12 pk1/seg10 pk0/seg9 cvcc pl3/seg20 vss pk2/seg11 fp-100b tfp-100b tfp-100g (top view) figure 1.4 pin arrangement of h8s/2264 series
rev. 2.0, 09/02, page 7 of 658 1.4 pin functions table 1.1 lists the pins functions. table 1.1 pin functions type symbol pin no. i/o function power supply vcc 62 input power supply pin. connect this pin to the system power supply. cvcc 12 input connect this pin to vss via a 0.1-f capacitor for voltage stabilization. note that applying a voltage exceeding 4.3 v, the absolute maximum rating, to the cvcc pin may cause fatal damages on this lsi. do not connect the power supply to the cvcc pin. see section 24, power supply circuit, for connecting examples. v3 v2 v1 85 86 87 input power supply pins for the lcd controller/driver. with an internal power supply division resistor, these pins are normally left open. power supply should be within the range of vcc v1 v2 v3 vss. when the triple step-up voltage circuit * 2 is used, the v3 pin is used for the lcd input reference power supply. vss 14 64 input ground pins. connect this pin to the system power supply (0v). clock xtal 63 input for connection to a crystal resonator or a ceramic resonator * 3 . for examples of crystal or ceramic * 3 resonator connection and external clock input, see section 21, clock pulse generator. extal 65 input for connection to a crystal resonator or a ceramic resonator * 3 . this pin can be also used for external clock input. for examples of crystal or ceramic * 3 resonator connection and external clock input, see section 21, clock pulse generator. osc1 58 input connects to a 32.768 khz crystal resonator. see section 21, clock pulse generator, for typical connection diagrams for a crystal resonator. osc2 57 input connects to a 32.768 khz crystal resonator. see section 21, clock pulse generator, for typical connection diagrams for a crystal resonator. * 1 84 output supplies clock pulses to external devices.
rev. 2.0, 09/02, page 8 of 658 type symbol pin no. i/o function operating mode control md2, md1 67 56 input sets the operating mode. inputs at these pins should not be changed during operation. be sure to fix the levels of the mode pins (md2, md1) by pull-down or pull-up, except for mode changing. system control res 59 input reset input pin. when this pin is low, the chip enters in the power-on reset state. stby 61 input when this pin is low, a transition is made to hardware standby mode. fwe 66 input enables/disables programming the flash memory. interrupts nmi 60 input nonmaskable interrupt pin. if this pin is not used, it should be fixed-high. irq5 * 2 irq4 irq3 irq1 irq0 81 78 82 40 38 input these pins request a maskable interrupt. wkp7 to wkp0 26 to 33 input these pins request a wakeup interrupt. this interrupt is maskable. 16-bit timer- pulse unit (tpu) tclkd * 2 tclkc tclkb tclka 41 39 37 36 input these pins input an external clock. tioca0 * 2 tiocb0 * 2 tiocc0 * 2 tiocd0 * 2 34 35 36 37 input/ output pins for the tgra_0 to tgrd_0 input capture input or output compare output, or pwm output. tioca1 tiocb1 38 39 input/ output pins for the tgra _ 1 and tgrb _ 1 input capture input or output compare output, or pwm output. tioca2 tiocb2 40 41 input/ output pins for the tgra _ 2 and tgrb _ 2 input capture input or output compare output, or pwm output. 8-bit timer tmo3 * 2 tmo2 * 2 tmo1 tmo0 70 71 72 73 output compare-match output pins tmci23 * 2 tmci01 tmci4 * 2 74 75 55 input pins for external clock input to the counter tmri23 * 2 tmri01 74 75 input counter reset input pins.
rev. 2.0, 09/02, page 9 of 658 type symbol pin no. i/o function serial communi- cation txd2 txd1 txd0 68 79 76 output data output pins interface (sci)/ smart card rxd2 rxd1 rxd0 69 80 77 input data input pins interface sck2 sck1 sck0 70 81 78 input/ output clock input/output pins scl1 * 2 scl0 79 81 input/ output i 2 c clock input/output pins. i 2 c bus interface (optional) sda1 * 2 sda0 78 80 input/ output i 2 c data input/output pins. a/d converter an9 to an0 43 to 52 input analog input pins adtrg 82 input pin for input of an external trigger to start a/d conversion d/a converter * 2 da1 da0 43 44 output analog output pins for the d/a converter * 2 . a/d converter, d/a converter * 2 avcc 54 input power supply pin for the a/d converter, d/a converter * 2 and dtmf generation circuit * 2 . if none of the a/d converter, d/a converter * 2 and dtmf generation circuit * 2 is used, connect this pin to the system power supply (+5 v). avss 42 input ground pin for the a/d converter, d/a converter * 2 , and dtmf generator * 2 . connect this pin to the system power supply (0 v). vref 53 input reference voltage input pin for the a/d converter and d/a converter * 2 . if neither the a/d converter nor d/a converter * 2 is used, connect this pin to the system power supply (+5 v). lcd controller/ driver seg40 to seg 1 92 to 100, 1 to 11, 13, 15 to 33 output lcd segment output pins com4 to com1 88 to 91 output lcd common output pins c2 * 2 c1 * 2 83 84 ? pins for the step-up voltage capacitor of the lcd drive power supply.
rev. 2.0, 09/02, page 10 of 658 type symbol pin no. i/o function dtmf generatio n circuit * 2 toned 55 output dtmf signal output pin. i/o ports p17 to p10 41 to 34 input/ output 8-bit i/o pins p35 to p30 81 to 76 input/ output 6-bit i/o pins p47 to p40 45 to 52 input 8-bit input pins p77 to p70 68 to 75 input/ output 8-bit i/o pins p97 p96 43 44 input 2-bit input pins pf3 82 input/ output 1-bit i/o pin ph7 55 input 1-bit input pin ph5 * 1 ph4 * 1 83 84 input/ output 2-bit i/o pins ph3 to ph0 88 to 91 input/ output 4-bit i/o pins pj7 to pj0 26 to 33 input/ output 8-bit i/o pins pk7 to pk0 18 to 25 input/ output 8-bit i/o pins pl7 pl6 pl5 pl4 pl3 pl2 pl1 pl0 8 9 10 11 13 15 16 17 input/ output 8-bit i/o pins pm7 * 2 pm6 * 2 pm5 * 2 pm4 * 2 pm3 * 2 pm2 * 2 pm1 * 2 pm0 * 2 100 1 2 3 4 5 6 7 input/ output 8-bit i/o pins
rev. 2.0, 09/02, page 11 of 658 type symbol pin no. i/o function i/o ports pn7 to pn0 * 2 92 to 99 input/ output 8-bit i/o pins notes: 1. supported only by the h8s/2264 series. 2. supported only by the h8s/2268 series. 3. supported only by the h8s/2264r and h8s/2262r.
rev. 2.0, 09/02, page 12 of 658
rev. 2.0, 09/02, page 13 of 658 section 2 cpu the h8s/2000 cpu is a high-speed central processing unit with an internal 32-bit architecture that is upward-compatible with the h8/300 and h8/300h cpus. the h8s/2000 cpu has sixteen 16-bit general registers, can address a 16-mbyte linear address space, and is ideal for realtime control. this section describes the h8s/2000 cpu. the usable modes and address spaces differ depending on the product. for details on each product, refer to section 3, mcu operating modes. 2.1 features ? upward-compatible with h8/300 and h8/300h cpu ? can execute h8/300 and h8/300h cpu object programs ? general-register architecture ? sixteen 16-bit general registers also usable as sixteen 8-bit registers or eight 32-bit registers ? sixty-five basic instructions ? 8/16/32-bit arithmetic and logic instructions ? multiply and divide instructions ? powerful bit-manipulation instructions ? eight addressing modes ? register direct [rn] ? register indirect [@ern] ? register indirect with displacement [@(d:16,ern) or @(d:32,ern)] ? register indirect with post-increment or pre-decrement [@ern+ or @?ern] ? absolute address [@aa:8, @aa:16, @aa:24, or @aa:32] ? immediate [#xx:8, #xx:16, or #xx:32] ? program-counter relative [@(d:8,pc) or @(d:16,pc)] ? memory indirect [@@aa:8] ? 16-mbyte address space ? program: 16 mbytes ? data: 16 mbytes ? high-speed operation ? all frequently-used instructions execute in one or two states ? 8/16/32-bit register-register add/subtract : 1 state ? 8 8-bit register-register multiply : 12 states ? 16 8-bit register-register divide : 12 states ? 16 16-bit register-register multiply : 20 states ? 32 16-bit register-register divide : 20 states
rev. 2.0, 09/02, page 14 of 658 ? two cpu operating modes ? normal mode* ? advanced mode ? power-down state ? transition to power-down state by a sleep instruction ? cpu clock speed selection note: * normal mode is not available in this lsi. 2.1.1 differences between h8s/2600 cpu and h8s/2000 cpu the differences between the h8s/2600 cpu and the h8s/2000 cpu are shown below. ? register configuration ? the mac register is supported by the h8s/2600 cpu only. ? basic instructions ? the four instructions mac, clrmac, ldmac, and stmac are supported by the h8s/2600 cpu only. ? the number of execution states of the mulxu and mulxs instructions; execution states instruction mnemonic h8s/2600 h8s/2000 mulxu mulxu.b rs, rd 3 12 mulxu.w rs, erd 4 20 mulxs mulxs.b rs, rd 4 13 mulxs.w rs, erd 5 21 in addition, there are differences in address space, ccr and exr* register functions, and power- down modes, etc., depending on the model. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 15 of 658 2.1.2 differences from h8/300 cpu in comparison to the h8/300 cpu, the h8s/2000 cpu has the following enhancements: ? more general registers and control registers ? eight 16-bit expanded registers, and one 8-bit and two 32-bit control registers, have been added. ? expanded address space ? normal mode supports the same 64-kbyte address space as the h8/300 cpu. ? advanced mode supports a maximum 16-mbyte address space. ? enhanced addressing ? the addressing modes have been enhanced to make effective use of the 16-mbyte address space. ? enhanced instructions ? addressing modes of bit-manipulation instructions have been enhanced. ? signed multiply and divide instructions have been added. ? two-bit shift instructions have been added. ? instructions for saving and restoring multiple registers have been added. ? a test and set instruction has been added. ? higher speed ? basic instructions execute twice as fast. 2.1.3 differences from h8/300h cpu in comparison to the h8/300h cpu, the h8s/2000 cpu has the following enhancements: ? additional control register ? one 8-bit control registers have been added. ? enhanced instructions ? addressing modes of bit-manipulation instructions have been enhanced. ? two-bit shift instructions have been added. ? instructions for saving and restoring multiple registers have been added. ? a test and set instruction has been added. ? higher speed ? basic instructions execute twice as fast.
rev. 2.0, 09/02, page 16 of 658 2.2 cpu operating modes the h8s/2000 cpu has two operating modes: normal and advanced. normal mode supports a maximum 64-kbyte address space. advanced mode supports a maximum 16-mbyte total address space. the mode is selected by the mode pins. 2.2.1 normal mode the exception vector table and stack have the same structure as in the h8/300 cpu. ? address space linear access is provided to a maximum address space of 64 kbytes. ? extended registers (en) the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers. when en is used as a 16-bit register it can contain any value, even when the corresponding general register (rn) is used as an address register. if the general register is referenced in the register indirect addressing mode with pre-decrement (@?rn) or post-increment (@rn+) and a carry or borrow occurs, however, the value in the corresponding extended register (en) will be affected. ? instruction set all instructions and addressing modes can be used. only the lower 16 bits of effective addresses (ea) are valid. ? exception vector table and memory indirect branch addresses in normal mode the top area starting at h'0000 is allocated to the exception vector table. one branch address is stored per 16 bits. figure 2.1 shows the structure of the exception vector table in normal mode. for details of the exception vector table, see section 4, exception handling. the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in normal mode the operand is a 16-bit word operand, providing a 16-bit branch address. branch addresses can be stored in the top area from h'0000 to h'00ff. note that this area is also used for the exception vector table. ? stack structure when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc, condition-code register (ccr) and extended control register (exr) are pushed onto the stack in exception handling, they are stored as shown in figure 2.2. exr is not pushed onto the stack in interrupt control mode 0. for details, see section 4, exception handling. note: * normal mode is not available in this lsi.
rev. 2.0, 09/02, page 17 of 658 h'0000 h'0001 h'0002 h'0003 h'0004 h'0005 h'0006 h'0007 h'0008 h'0009 h'000a h'000b reset exception vector (reserved for system use) exception vector 1 exception vector 2 exception vector table figure 2.1 exception vector table (normal mode) pc (16 bits) exr * 1 reserved * 1 , * 3 ccr ccr * 3 pc (16 bits) sp sp (sp * 2 1. when exr is not used it is not stored on the stack. 2. sp when exr is not used. 3. lgnored when returning. notes: (b) exception handling (a) subroutine branch ) figure 2.2 stack structure in normal mode 2.2.2 advanced mode ? address space linear access is provided to a maximum 16-mbyte address space. ? extended registers (en) the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers or address registers. ? instruction set all instructions and addressing modes can be used.
rev. 2.0, 09/02, page 18 of 658 ? exception vector table and memory indirect branch addresses in advanced mode, the top area starting at h'00000000 is allocated to the exception vector table in units of 32 bits. in each 32 bits, the upper 8 bits are ignored and a branch address is stored in the lower 24 bits (figure 2.3). for details of the exception vector table, see section 4, exception handling. h'00000000 h'00000003 h'00000004 h'0000000b h'0000000c h'00000010 h'00000008 h'00000007 reserved reserved reset exception vector exception vector 3 exception vector table exception vector 1 figure 2.3 exception vector table (advanced mode) the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in advanced mode, the operand is a 32-bit longword operand, providing a 32-bit branch address. the upper 8 bits of these 32 bits is a reserved area that is regarded as h'00. branch addresses can be stored in the area from h'00000000 to h'000000ff. note that the first part of this range is also the exception vector table. ? stack structure in advanced mode, when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc, condition-code register (ccr), and extended control register (exr*) are pushed onto the stack in exception handling, they are stored as shown in figure 2.4. when exr* is invalid, it is not pushed onto the stack. for details, see section 4, exception handling. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 19 of 658 pc (24 bits) exr * 1 , * 4 reserved * 1 , * 3 , * 4 ccr pc (24 bits) sp sp (sp * 2 reserved (a) subroutine branch (b) exception handling notes: 1. when exr is not used it is not stored on the stack. 2. sp when exr is not used (the h8s/2264 series sp always points here). 3. ignored when returning. 4. supported only by the h8s/2268 series. ) figure 2.4 stack structure in advanced mode
rev. 2.0, 09/02, page 20 of 658 2.3 address space figure 2.5 shows a memory map of the h8s/2000 cpu. the h8s/2000 cpu provides linear access to a maximum 64-kbyte address space in normal mode, and a maximum 16-mbyte (architecturally 4-gbyte) address space in advanced mode. the usable modes and address spaces differ depending on the product. for details on each product, refer to section 3, mcu operating modes. h'0000 h'ffff h'00000000 h'ffffffff h'00ffffff 64-kbyte 16-mbyte program area data area (b) advanced mode (a) normal mode note: normal mode is not available in this lsi figure 2.5 memory map
rev. 2.0, 09/02, page 21 of 658 2.4 register configuration the h8s/2000 cpu has the internal registers shown in figure 2.6. there are two types of registers: general registers and control registers. control registers are a 24-bit program counter (pc), an 8-bit extended control register (exr*), and an 8-bit condition code register (ccr). note: * supported only by the h8s/2268 series. t i2i1i0 exr * 1 76543210 pc 23 0 15 0 7 0 7 0 e0 e1 e2 e3 e4 e5 e6 e7 r0h r1h r2h r3h r4h r5h r6h r7h r0l r1l r2l r3l r4l r5l r6l r7l sp pc exr t i2 to i0 ccr i ui :stack pointer :program counter :extended control register * 1 :trace bit * 1 :interrupt mask bits * 1 :condition-code register * 1 :interrupt mask bit :user bit or interrupt mask bit * 2 :half-carry flag :user bit :negative flag :zero flag :overflow flag :carry flag er0 er1 er2 er3 er4 er5 er6 er7 (sp) iuihunzvc ccr 76543210 h u n z v c general registers (rn) and extended registers (en) control registers (cr) legend ---- notes: 1. supported only by the h8s/2268 series. 2. the interrupt mask bit is not available in this lsi. figure 2.6 cpu registers
rev. 2.0, 09/02, page 22 of 658 2.4.1 general registers the h8s/2000 cpu has eight 32-bit general registers. these general registers are all functionally alike and can be used as both address registers and data registers. when a general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8-bit register. figure 2.7 illustrates the usage of the general registers. when the general registers are used as 32-bit registers or address registers, they are designated by the letters er (er0 to er7). the er registers divide into 16-bit general registers designated by the letters e (e0 to e7) and r (r0 to r7). these registers are functionally equivalent, providing a maximum sixteen 16-bit registers. the e registers (e0 to e7) are also referred to as extended registers. the r registers divide into 8-bit general registers designated by the letters rh (r0h to r7h) and rl (r0l to r7l). these registers are functionally equivalent, providing a maximum sixteen 8-bit 2egisters. the usage of each register can be selected independently. general register er7 has the function of stack pointer (sp) in addition to its general-register function, and is used implicitly in exception handling and subroutine calls. figure 2.8 shows the stack. ? address registers  32-bit registers  16-bit registers  8-bit registers er registers (er0 to er7) e registers (extended registers) (e0 to e7) r registers (r0 to r7) rh registers (r0h to r7h) rl registers (r0l to r7l) figure 2.7 usage of general registers
rev. 2.0, 09/02, page 23 of 658 sp (er7) free area stack area figure 2.8 stack status 2.4.2 program counter (pc) this 24-bit counter indicates the address of the next instruction the cpu will execute. the length of all cpu instructions is 2 bytes (one word), so the least significant pc bit is ignored. (when an instruction is fetched, the least significant pc bit is regarded as 0.) 2.4.3 extended control register (exr) (h8s/2268 series only) exr is an 8-bit register that manipulates the ldc, stc, andc, orc, and xorc instructions. when these instructions except for the stc instruction is executed, all interrupts including nmi will be masked for three states after execution is completed. bit bit name initial value r/w description 7 t 0 r/w trace bit when this bit is set to 1, a trace exception is generated each time an instruction is executed. when this bit is cleared to 0, instructions are executed in sequence. 6 to 3 ? 1 ? reserved these bits are always read as 1. 2 1 0 i2 i1 i0 1 1 1 r/w r/w r/w these bits designate the interrupt mask level (0 to 7). for details, refer to section 5, interrupt controller.
rev. 2.0, 09/02, page 24 of 658 2.4.4 condition-code register (ccr) this 8-bit register contains internal cpu status information, including an interrupt mask bit (i) and half-carry (h), negative (n), zero (z), overflow (v), and carry (c) flags. operations can be performed on the ccr bits by the ldc, stc, andc, orc, and xorc instructions. the n, z, v, and c flags are used as branching conditions for conditional branch (bcc) instructions. bit bit name initial value r/w description 7 i 1 r/w interrupt mask bit masks interrupts other than nmi when set to 1. nmi is accepted regardless of the i bit setting. the i bit is set to 1 by hardware at the start of an exception-handling sequence. for details, refer to section 5, interrupt controller. 6 ui undefined r/w user bit or interrupt mask bit can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. this bit cannot be used as an interrupt mask bit in this lsi. 5 h undefined r/w half-carry flag when the add.b, addx.b, sub.b, subx.b, cmp.b, or neg.b instruction is executed, this flag is set to 1 if there is a carry or borrow at bit 3, and cleared to 0 otherwise. when the add.w, sub.w, cmp.w, or neg.w instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 11, and cleared to 0 otherwise. when the add.l, sub.l, cmp.l, or neg.l instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 27, and cleared to 0 otherwise. 4 u undefined r/w user bit can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. 3 n undefined r/w negative flag stores the value of the most significant bit of data as a sign bit.
rev. 2.0, 09/02, page 25 of 658 bit bit name initial value r/w description 2 z undefined r/w zero flag set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data. 1 v undefined r/w overflow flag set to 1 when an arithmetic overflow occurs, and cleared to 0 at other times. 0 c undefined r/w carry flag set to 1 when a carry occurs, and cleared to 0 otherwise. used by: ? add instructions, to indicate a carry ? subtract instructions, to indicate a borrow ? shift and rotate instructions, to indicate a carry the carry flag is also used as a bit accumulator by bit manipulation instructions. 2.4.5 initial values of cpu registers reset exception handling loads the cpu's program counter (pc) from the vector table, clears the trace bit in exr* to 0, and sets the interrupt mask bits in ccr and exr* to 1. the other ccr bits and the general registers are not initialized. in particular, the stack pointer (er7) is not initialized. the stack pointer should therefore be initialized by an mov.l instruction executed immediately after a reset. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 26 of 658 2.5 data formats the h8s/2000 cpu can process 1-bit, 4-bit (bcd), 8-bit (byte), 16-bit (word), and 32-bit (longword) data. bit-manipulation instructions operate on 1-bit data by accessing bit n (n = 0, 1, 2, ?, 7) of byte operand data. the daa and das decimal-adjust instructions treat byte data as two digits of 4-bit bcd data. 2.5.1 general register data formats figure 2.9 shows the data formats in general registers. 70 70 msb lsb msb lsb 70 43 don't care don't care don't care 70 43 70 don't care 65432 710 70 don't care 65432 710 don't care rnh rnl rnh rnl rnh rnl data type register number data format byte data byte data 4-bit bcd data 4-bit bcd data 1-bit data 1-bit data upper lower upper lower figure 2.9 general register data formats (1)
rev. 2.0, 09/02, page 27 of 658 15 0 msb lsb 15 0 msb lsb 31 16 msb 15 0 lsb en rn ern en rn rnh rnl msb lsb : general register er : general register e : general register r : general register rh : general register rl : most significant bit : least significant bit data type data format register number word data word data rn en longword data legend ern figure 2.9 general register data formats (2)
rev. 2.0, 09/02, page 28 of 658 2.5.2 memory data formats figure 2.10 shows the data formats in memory. the h8s/2000 cpu can access word data and longword data in memory, but word or longword data must begin at an even address. if an attempt is made to access word or longword data at an odd address, no address error occurs but the least significant bit of the address is regarded as 0, so the access starts at the preceding address. this also applies to instruction fetches. when er7 is used as an address register to access the stack, the operand size should be word or longword. 70 76 543210 msb lsb msb msb lsb lsb data type address 1-bit data byte data word data address l address l address 2m address 2m+1 longword data address 2n address 2n+1 address 2n+2 address 2n+3 data format figure 2.10 memory data formats
rev. 2.0, 09/02, page 29 of 658 2.6 instruction set the h8s/2000 cpu has 65 types of instructions. the instructions are classified by function in table 2.1. table 2.1 instruction classification function instructions size types data transfer mov b/w/l 5 pop * 1 , push * 1 w/l ldm, stm l movfpe * 3 , movtpe * 3 b arithmetic add, sub, cmp, neg b/w/l 19 operations addx, subx, daa, das b inc, dec b/w/l adds, subs l mulxu, divxu, mulxs, divxs b/w extu, exts w/l tas * 4 b logic operations and, or, xor, not b/w/l 4 shift shal, shar, shll, shlr, rotl, rotr, rotxl, rotxr b/w/l 8 bit manipulation bset, bclr, bnot, btst, bld, bild, bst, bist, band, biand, bor, bior, bxor, bixor b14 branch bcc * 2 , jmp, bsr, jsr, rts ? 5 system control trapa, rte, sleep, ldc, stc, andc, orc, xorc, nop ? 9 block data transfer eepmov ? 1 total: 65 notes: b-byte; w-word; l-longword. 1. pop.w rn and push.w rn are identical to mov.w @sp+, rn and mov.w rn, @-sp. pop.l ern and push.l ern are identical to mov.l @sp+, ern and mov.l ern, @-sp. 2. bcc is the general name for conditional branch instructions. 3. cannot be used in this lsi. 4. only register er0, er1, er4, or er5 should be used when using the tas instruction.
rev. 2.0, 09/02, page 30 of 658 2.6.1 table of instructions classified by function tables 2.3 to 2.10 summarize the instructions in each functional category. the notation used in tables 2.3 to 2.10 is defined below. table 2.2 operation notation symbol description rd general register (destination) * 1 rs general register (source) * 1 rn general register * 1 ern general register (32-bit register) (ead) destination operand (eas) source operand exr extended control register * 2 ccr condition-code register n n (negative) flag in ccr z z (zero) flag in ccr v v (overflow) flag in ccr c c (carry) flag in ccr pc program counter sp stack pointer #imm immediate data disp displacement + addition ? subtraction multiplication division logical and logical or logical xor move ? not (logical complement) :8/:16/:24/:32 8-, 16-, 24-, or 32-bit length notes: 1. general registers include 8-bit registers (r0h to r7h, r0l to r7l), 16-bit registers (r0 to r7, e0 to e7), and 32-bit registers (er0 to er7). 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 31 of 658 table 2.3 data transfer instructions instruction size * function mov b/w/l (eas) rd, rs (ead) moves data between two general registers or between a general register and memory, or moves immediate data to a general register. movfpe b cannot be used in this lsi. movtpe b cannot be used in this lsi. pop w/l @sp+ rn pops a general register from the stack. pop.w rn is identical to mov.w @sp+, rn. pop.l ern is identical to mov.l @sp+, ern. push w/l rn @?sp pushes a general register onto the stack. push.w rn is identical to mov.w rn, @?sp. push.l ern is identical to mov.l ern, @?sp. ldm l @sp+ rn (register list) pops two or more general registers from the stack. stm l rn (register list) @?sp pushes two or more general registers onto the stack. note: * refers to the operand size. b: byte w: word l: longword
rev. 2.0, 09/02, page 32 of 658 table 2.4 arithmetic operations instructions (1) instruction size * function add sub b/w/l rd rs rd, rd #imm rd performs addition or subtraction on data in two general registers, or on immediate data and data in a general register (immediate byte data cannot be subtracted from byte data in a general register. use the subx or add instruction.) addx subx b rd rs c rd, rd #imm c rd performs addition or subtraction with carry on byte data in two general registers, or on immediate data and data in a general register. inc dec b/w/l rd 1 rd, rd 2 rd increments or decrements a general register by 1 or 2. (byte operands can be incremented or decremented by 1 only.) adds subs l rd 1 rd, rd 2 rd, rd 4 rd adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register. daa das b rd decimal adjust rd decimal-adjusts an addition or subtraction result in a general register by referring to the ccr to produce 4-bit bcd data. mulxu b/w rd rs rd performs unsigned multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits. mulxs b/w rd rs rd performs signed multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits. divxu b/w rd rs rd performs unsigned division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder. note: * refers to the operand size. b: byte w: word l: longword
rev. 2.0, 09/02, page 33 of 658 table 2.4 arithmetic operations instructions (2) instruction size * 1 function divxs b/w rd rs rd performs signed division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder. cmp b/w/l rd ? rs, rd ? #imm compares data in a general register with data in another general register or with immediate data, and sets ccr bits according to the result. neg b/w/l 0 ? rd rd takes the two's complement (arithmetic complement) of data in a general register. extu w/l rd (zero extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by padding with zeros on the left. exts w/l rd (sign extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by extending the sign bit. tas * 2 b @erd ? 0, 1 ( of @erd) tests memory contents, and sets the most significant bit (bit 7) to 1. notes: 1. refers to the operand size. b: byte w: word l: longword 2. only register er0, er1, er4, or er5 should be used when using the tas instruction.
rev. 2.0, 09/02, page 34 of 658 table 2.5 logic operations instructions instruction size * function and b/w/l rd rs rd, rd #imm rd performs a logical and operation on a general register and another general register or immediate data. or b/w/l rd rs rd, rd #imm rd performs a logical or operation on a general register and another general register or immediate data. xor b/w/l rd rs rd, rd #imm rd performs a logical exclusive or operation on a general register and another general register or immediate data. not b/w/l ? (rd) (rd) takes the one's complement of general register contents. note: * refers to the operand size. b: byte w: word l: longword table 2.6 shift instructions instruction size * function shal shar b/w/l rd (shift) rd performs an arithmetic shift on general register contents. 1-bit or 2-bit shifts are possible. shll shlr b/w/l rd (shift) rd performs a logical shift on general register contents. 1-bit or 2-bit shifts are possible. rotl rotr b/w/l rd (rotate) rd rotates general register contents. 1-bit or 2-bit rotations are possible. rotxl rotxr b/w/l rd (rotate) rd rotates general register contents through the carry flag. 1-bit or 2-bit rotations are possible. note: * refers to the operand size. b: byte w: word l: longword
rev. 2.0, 09/02, page 35 of 658 table 2.7 bit manipulation instructions (1) instruction size * function bset b 1 ( of ) sets a specified bit in a general register or memory operand to 1. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. bclr b 0 ( of ) clears a specified bit in a general register or memory operand to 0. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. bnot b ? ( of ) ( of ) inverts a specified bit in a general register or memory operand. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. btst b ? ( of ) z tests a specified bit in a general register or memory operand and sets or clears the z flag accordingly. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. band biand b b c ( of ) c ands the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c ands the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data. bor bior b b c ( of ) c ors the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c ors the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data. note: * refers to the operand size. b: byte
rev. 2.0, 09/02, page 36 of 658 table 2.7 bit manipulation instructions (2) instruction size * function bxor bixor b b c ( of ) c xors the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c xors the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data. bld bild b b ( of ) c transfers a specified bit in a general register or memory operand to the carry flag. ? ( of ) c transfers the inverse of a specified bit in a general register or memory operand to the carry flag. the bit number is specified by 3-bit immediate data. bst bist b b c ( of ) transfers the carry flag value to a specified bit in a general register or memory operand. ? c ( of ) transfers the inverse of the carry flag value to a specified bit in a general register or memory operand. the bit number is specified by 3-bit immediate data. note: * refers to the operand size. b: byte
rev. 2.0, 09/02, page 37 of 658 table 2.8 branch instructions instruction size function bcc ? branches to a specified address if a specified condition is true. the branching conditions are listed below. mnemonic description condition bra(bt) always (true) always brn(bf) never (false) never bhi high c z = 0 bls low or same c z = 1 bcc(bhs) carry clear (high or same) c = 0 bcs(blo) carry set (low) c = 1 bne not equal z = 0 beq equal z = 1 bvc overflow clear v = 0 bvs overflow set v = 1 bpl plus n = 0 bmi minus n = 1 bge greater or equal n v = 0 blt less than n v = 1 bgt greater than z (n v) = 0 ble less or equal z (n v) = 1 jmp ? branches unconditionally to a specified address. bsr ? branches to a subroutine at a specified address. jsr ? branches to a subroutine at a specified address. rts ? returns from a subroutine
rev. 2.0, 09/02, page 38 of 658 table 2.9 system control instructions instruction size * 1 function trapa ? starts trap-instruction exception handling. rte ? returns from an exception-handling routine. sleep ? causes a transition to a power-down state. ldc b/w (eas) ccr, (eas) exr * 2 moves the source operand contents or immediate data to ccr or exr * 2 . although ccr and exr * 2 are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid. stc b/w ccr (ead), exr * 2 (ead) transfers ccr or exr * 2 contents to a general register or memory. although ccr and exr * 2 are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid. andc b ccr #imm ccr, exr #imm exr * 2 logically ands the ccr or exr * 2 contents with immediate data. orc b ccr #imm ccr, exr #imm exr * 2 logically ors the ccr or exr * 2 contents with immediate data. xorc b ccr #imm ccr, exr #imm exr * 2 logically xors the ccr or exr * 2 contents with immediate data. nop ? pc + 2 pc only increments the program counter. notes: 1. refers to the operand size. b: byte w: word 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 39 of 658 table 2.10 block data transfer instructions instruction size function eepmov.b ? if r4l 0 then repeat @er5+ @er6+ r4l?1 r4l until r4l = 0 else next; eepmov.w ? if r4 0 then repeat @er5+  @er6+ r4?1  r4 until r4 = 0 else next; transfers a data block. starting from the address set in er5, transfers data for the number of bytes set in r4l or r4 to the address location set in er6. execution of the next instruction begins as soon as the transfer is completed. 2.6.2 basic instruction formats this lsi instructions consist of 2-byte (1-word) units. an instruction consists of an operation field (op field), a register field (r field), an effective address extension (ea field), and a condition field (cc). figure 2.11 shows examples of instruction formats. ? operation field indicates the function of the instruction, the addressing mode, and the operation to be carried out on the operand. the operation field always includes the first four bits of the instruction. some instructions have two operation fields. ? register field specifies a general register. address registers are specified by 3 bits, and data registers by 3 bits or 4 bits. some instructions have two register fields. some have no register field. ? effective address extension 8, 16, or 32 bits specifying immediate data, an absolute address, or a displacement. ? condition field specifies the branching condition of bcc instructions.
rev. 2.0, 09/02, page 40 of 658 op op rn rm nop, rts, etc. add.b rn, rm, etc. mov.b @(d:16, rn), rm, etc. rn rm op ea(disp) op cc ea(disp) bra d:16, etc. (1) operation field only (2) operation field and register fields (3) operation field, register fields, and effective address extension (4) operation field, effective address extension, and condition field figure 2.11 instruction formats (examples) 2.7 addressing modes and effective address calculation the h8s/2000 cpu supports the eight addressing modes listed in table 2.11. each instruction uses a subset of these addressing modes. arithmetic and logic instructions can use the register direct and immediate modes. data transfer instructions can use all addressing modes except program- counter relative and memory indirect. bit manipulation instructions use register direct, register indirect, or the absolute addressing mode to specify an operand, and register direct (bset, bclr, bnot, and btst instructions) or immediate (3-bit) addressing mode to specify a bit number in the operand. table 2.11 addressing modes no. addressing mode symbol 1 register direct rn 2 register indirect @ern 3 register indirect with displacement @(d:16,ern)/@(d:32,ern) 4 register indirect with post-increment register indirect with pre-decrement @ern+ @?ern 5 absolute address @aa:8/@aa:16/@aa:24/@aa:32 6 immediate #xx:8/#xx:16/#xx:32 7 program-counter relative @(d:8,pc)/@(d:16,pc) 8 memory indirect @@aa:8
rev. 2.0, 09/02, page 41 of 658 2.7.1 register direct ? ? ? ? rn the register field of the instruction specifies an 8-, 16-, or 32-bit general register containing the operand. r0h to r7h and r0l to r7l can be specified as 8-bit registers. r0 to r7 and e0 to e7 can be specified as 16-bit registers. er0 to er7 can be specified as 32-bit registers. 2.7.2 register indirect ? ? ? ? @ern the register field of the instruction code specifies an address register (ern) which contains the address of the operand on memory. if the address is a program instruction address, the lower 24 bits are valid and the upper 8 bits are all assumed to be 0 (h'00). 2.7.3 register indirect with displacement ? ? ? ? @(d:16, ern) or @(d:32, ern) a 16-bit or 32-bit displacement contained in the instruction is added to an address register (ern) specified by the register field of the instruction, and the sum gives the address of a memory operand. a 16-bit displacement is sign-extended when added. 2.7.4 register indirect with post-increment or pre-decrement ? ? ? ? @ern+ or @-ern register indirect with post-increment ? ? ? ? @ern+: the register field of the instruction code specifies an address register (ern) which contains the address of a memory operand. after the operand is accessed, 1, 2, or 4 is added to the address register contents and the sum is stored in the address register. the value added is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. for the word or longword transfer instructions, the register value should be even. register indirect with pre-decrement ? ? ? ? @-ern: the value 1, 2, or 4 is subtracted from an address register (ern) specified by the register field in the instruction code, and the result is the address of a memory operand. the result is also stored in the address register. the value subtracted is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. for the word or longword transfer instructions, the register value should be even. 2.7.5 absolute address ? ? ? ? @aa:8, @aa:16, @aa:24, or @aa:32 the instruction code contains the absolute address of a memory operand. the absolute address may be 8 bits long (@aa:8), 16 bits long (@aa:16), 24 bits long (@aa:24), or 32 bits long (@aa:32). table 2.12 indicates the accessible absolute address ranges. to access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits (@aa:32) long. for an 8-bit absolute address, the upper 24 bits are all assumed to be 1 (h'ffff). for a 16-bit absolute address the upper 16 bits are a sign extension. a 32-bit absolute address can access the entire address space.
rev. 2.0, 09/02, page 42 of 658 a 24-bit absolute address (@aa:24) indicates the address of a program instruction. the upper 8 bits are all assumed to be 0 (h'00). table 2.12 absolute address access ranges absolute address normal mode * advanced mode data address 8 bits (@aa:8) h'ff00 to h'ffff h'ffff00 to h'ffffff 16 bits (@aa:16) h'0000 to h'ffff h'000000 to h'007fff, h'ff8000 to h'ffffff 32 bits (@aa:32) h'000000 to h'ffffff program instruction address 24 bits (@aa:24) note: * normal mode is not available in this lsi. 2.7.6 immediate ? ? ? ? #xx:8, #xx:16, or #xx:32 the instruction contains 8-bit (#xx:8), 16-bit (#xx:16), or 32-bit (#xx:32) immediate data as an operand. the adds, subs, inc and dec instructions contain immediate data implicitly. some bit manipulation instructions contain 3-bit immediate data in the instruction code, specifying a bit number. the trapa instruction contains 2-bit immediate data in its instruction code, specifying a vector address. 2.7.7 program-counter relative ? ? ? ? @(d:8, pc) or @(d:16, pc) this mode is used in the bcc and bsr instructions. an 8-bit or 16-bit displacement contained in the instruction is sign-extended and added to the 24-bit pc contents to generate a branch address. only the lower 24 bits of this branch address are valid; the upper 8 bits are all assumed to be 0 (h'00). the pc value to which the displacement is added is the address of the first byte of the next instruction, so the possible branching range is ?126 to +128 bytes (?63 to +64 words) or ?32766 to +32768 bytes (?16383 to +16384 words) from the branch instruction. the resulting value should be an even number. 2.7.8 memory indirect ? ? ? ? @@aa:8 this mode can be used by the jmp and jsr instructions. the instruction code contains an 8-bit absolute address specifying a memory operand. this memory operand contains a branch address. the upper bits of the absolute address are all assumed to be 0, so the address range is 0 to 255 (h'0000 to h'00ff in normal mode*, h'000000 to h'0000ff in advanced mode). in normal mode, the memory operand is a word operand and the branch address is 16 bits long. in advanced mode, the memory operand is a longword operand, the first byte of which is assumed to be 0 (h'00).
rev. 2.0, 09/02, page 43 of 658 note that the first part of the address range is also the exception vector area. for further details, refer to section 4, exception handling. if an odd address is specified in word or longword memory access, or as a branch address, the least significant bit is regarded as 0, causing data to be accessed or instruction code to be fetched at the address preceding the specified address. (for further information, see section 2.5.2, memory data formats.) note: * normal mode is not available in this lsi. specified by @aa:8 specified by @aa:8 branch address branch address reserved (a) normal mode * (a) advanced mode note: * normal mode is not available in this lsi. figure 2.12 branch address specification in memory indirect mode 2.7.9 effective address calculation table 2.13 indicates how effective addresses are calculated in each addressing mode. in normal mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address.
rev. 2.0, 09/02, page 44 of 658 table 2.13 effective address calculation (1) no 1 offset 1 2 4 r op 31 0 31 23 2 3 register indirect with displacement @ (d:16,ern) or @(d:32,ern) 4 r op disp r op rm op rn 31 0 31 0 r op don't care 31 23 31 0 don't care 31 0 disp 31 0 31 0 31 23 31 0 don't care 31 23 31 0 don't care 24 24 24 24 addressing mode and instruction format effective address calculation effective address (ea) register direct(rn) general register contents general register contents general register contents general register contents sign extension register indirect(@ern) register indirect with post-increment or pre-decrement  register indirect with post-increment @ern+  register indirect with pre-decrement @-ern 1, 2, or 4 1, 2, or 4 operand size byte word longword operand is general register contents.
rev. 2.0, 09/02, page 45 of 658 table 2.13 effective address calculation (2) no 5 op 31 23 31 0 don't care abs @aa:8 7 h'ffff op 31 23 31 0 don't care @aa:16 op @aa:24 @ aa:32 abs 15 16 31 23 31 0 don't care 31 23 31 0 don't care abs op abs 6 op imm #xx:8/#xx:16/#xx:32 8 24 24 24 24 addressing mode and instruction format absolute address immediate effective address calculation effective address (ea) sign extension operand is immediate data. 31 23 7 program-counter relative @ (d:8,pc) @(d:16,pc) memory indirect @@ aa:8  normal mode*  advanced mode 31 0 don't care 23 0 disp 0 31 23 31 0 don't care disp op 23 op 8 abs 31 0 abs h'000000 7 8 0 15 31 23 31 0 don't care 15 h'00 16 op abs 31 0 abs h'000000 7 8 0 31 24 24 24 note: * normal mode is not available in this lsi. pc contents sign extension memory contents memory contents
rev. 2.0, 09/02, page 46 of 658 2.8 processing states the h8s/2000 cpu has five main processing states: the reset state, exception handling state, program execution state, bus-released state, and power-down state. figure 2.13 indicates the state transitions. ? reset state in this state, the cpu and all on-chip peripheral modules are initialized and not operating. when the res input goes low, all current processing stops and the cpu enters the reset state. all interrupts are masked in the reset state. reset exception handling starts when the res signal changes from low to high. for details, refer to section 4, exception handling and section 23, power-on reset circuit*. the reset state can also be entered by a watchdog timer overflow. note: * supported only by the h8s/2264 series. ? exception-handling state the exception-handling state is a transient state that occurs when the cpu alters the normal processing flow due to an exception source, such as a reset, trace, interrupt, or trap instruction. the cpu fetches a start address (vector) from the exception vector table and branches to that address. for further details, refer to section 4, exception handling. ? program execution state in this state, the cpu executes program instructions in sequence. ? bus-released state (h8s/2268 series only) in a product which has a bus master other than the cpu, such as a data transfer controller (dtc), the bus-released state occurs when the bus has been released in response to a bus request from a bus master other than the cpu. while the bus is released, the cpu halts operations. ? power-down state this is a power-down state in which the cpu stops operating. the program stop state occurs when a sleep instruction is executed or the cpu enters hardware standby mode. for further details, refer to section 22, power-down modes.
rev. 2.0, 09/02, page 47 of 658 exception handling state bus-released state * 4 hardware standby mode * 2 software standby mode reset state * 1 sleep mode power-down state * 3 program execution state end of bus request * 4 bus request * 4 interrupt request external interrupt request = high request for exception handling = high, = low end of bus request * 4 bus request * 4 sleep instruction, ssby = 0 sleep instruction, ssby = 1 notes: 1. 2. 3. 4. from any state except hardware standby mode, a transition to the reset state occurs whenever goes low. a transition can also be made to the reset state when the watchdog timer overflows. from any state, a transition to hardware standby mode occurs when goes low. apart from these states, there are also the watch mode, subactive mode, and the subsleep mode. see section 22, power-down modes. supported only by the h8s/2268 series. end of exception handling figure 2.13 state transitions
rev. 2.0, 09/02, page 48 of 658 2.9 usage notes 2.9.1 tas instruction only register er0, er1, er4, or er5 should be used when using the tas instruction. the tas instruction is not generated by the hitachi h8s and h8/300 series c/c++ compilers. if the tas instruction is used as a user-defined intrinsic function, ensure that only register er0, er1, er4, or er5 is used. 2.9.2 stm/ldm instruction with the stm or ldm instruction, the er7 register is used as the stack pointer, and thus cannot be used as a register that allows save (stm) or restore (ldm) operation. with a single stm or ldm instruction, two to four registers can be saved or restored. the available registers are as follows: for two registers: er0 and er1, er2 and er3, or er4 and er5 for three registers: er0 to er2, or er4 to er6 for four registers: er0 to er3 for the hitachi h8s or h8/300 series c/c++ compiler, the stm/ldm instruction including er7 is not created. 2.9.3 bit manipulation instructions the bset, bclr, bnot, bst, and bist instructions are used to read data in byte-wise, operate the data in bit-wise, and write the result of the bit-wise operation in bit-wise again. therefore, special care is necessary to use these instructions for the registers and the ports that include write- only bit. the bclr instruction can be used to clear to 0 the flags in the internal i/o registers. in this time, if it is obvious that the flag has been set to 1 in the interrupt handler, there is no need to read the flag beforehand.
rev. 2.0, 09/02, page 49 of 658 section 3 mcu operating modes 3.1 operating mode selection this lsi supports only operating mode 7, that is, the advanced single-chip mode. the operating mode is determined by the setting of the mode pins (md2 and md1). only mode 7 can be used in this lsi. the h8s/2268 series does not include power-on reset circuit. therefore, all mode pins must be fixed high. while the h8s/2264 series includes a power-on reset circuit.. the power-on reset circuit can be enabled/disabled by mode pin settings. do not change the mode pin settings during operation. table 3.1 mcu operating mode selection external data bus mcu operating mode md2 md1 cpu operating mode description on-chip rom initial width max. width power-on reset circuit 7 1 1 advanced mode single-chip mode enabled ?? disabled 7 0 1 advanced mode single-chip mode enabled ?? enabled * note: * supported only by the h8s/2264 series. 3.2 register description the following registers are related to the operating mode. ? mode control register (mdcr)
rev. 2.0, 09/02, page 50 of 658 3.2.1 mode control register (mdcr) mdcr monitors the current operating mode. bit bit name initial value r/w descriptions 7 ? 1r/wreserved this bit is always read as 1 and cannot be modified. 6 to 3 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 2 1 mds2 mds1 ? ? r r mode select 2 and 1 these bits indicate the input levels at pins md2 and md1 (the current operating mode). bits mds2 and mds1 correspond to md2 and md1, respectively. mds2 and mds1 are read-only bits and they cannot be written to. the mode pin (md2 and md1) input levels are latched into these bits when mdcr is read. these latches are canceled by a reset. these latches are canceled by a reset. 0 ? 1 ? reserved this bit is always read as 1 and cannot be modified. 3.3 operating mode the cpu can access a 16-mbyte address space in advanced mode. on-chip rom is valid and the external address cannot be used. 3.4 pin functions in each operating mode for details on pin functions in each operating mode, refer to section 1, overview.
rev. 2.0, 09/02, page 51 of 658 3.5 address map figures 3.1 and 3.2 show the address map in each operating mode. h'000000 h'ffb000 h'03ffff h'000000 h'01ffff h'ffd000 h'ffefbf h'ffefbf h'fff800 h'fff800 h'ffff3f h'ffff3f h'ffff60 h'ffff60 h'ffffc0 h'ffffc0 h'ffffff h'ffffff h8s/2268 h8s/2266 rom: 128 kbytes, ram: 8 kbytes mode 7 advanced single-chip mode on-chip ram on-chip ram on-chip ram internal i/o registers internal i/o registers rom: 256 kbytes, ram: 16 kbytes mode 7 advanced single-chip mode on-chip ram on-chip ram on-chip ram internal i/o registers internal i/o registers figure 3.1 address map (1)
rev. 2.0, 09/02, page 52 of 658 h'00ffff h'000000 h'ffe800 h'ffefbf h'fff800 h'ffff3f h'ffff60 h'ffffc0 h'ffffff h8s/2262 and h8s/2262r rom: 64 kbytes, ram: 2 kbytes mode 7 advanced single-chip mode on-chip ram on-chip ram on-chip ram internal i/o registers internal i/o registers h'01ffff h'000000 h'ffe000 h'ffefbf h'fff800 h'ffff3f h'ffff60 h'ffffc0 h'ffffff h8s/2265, h8s/2264, and h8s/2264r rom: 128 kbytes, ram: 4 kbytes mode 7 advanced single-chip mode on-chip ram on-chip ram on-chip ram internal i/o registers internal i/o registers figure 3.2 address map (2)
rev. 2.0, 09/02, page 53 of 658 section 4 exception handling 4.1 exception handling types and priority as table 4.1 indicates, exception handling may be caused by a reset, trace*, trap instruction, or interrupt. exception handling is prioritized as shown in table 4.1. if two or more exceptions occur simultaneously, they are accepted and processed in order of priority. trap instruction exception handling requests are accepted at all times in program execution state. exception sources, the stack structure, and operation of the cpu vary depending on the interrupt control mode set by the intm0 and intm1 bits in syscr. table 4.1 exception types and priority priority exception type start of exception handling high reset starts immediately after a low-to-high transition at the res pin, or when the watchdog timer overflows. the cpu enters the reset state when the res pin is low. trace * starts when execution of the current instruction or exception handling ends, if the trace (t) bit in the exr is set to 1. traces are enabled only in interrupt control mode 2. trace exception handling is not executed after execution of an rte instruction. interrupt starts when execution of the current instruction or exception handling ends, if an interrupt request has been issued. interrupt detection is not performed on completion of andc, orc, xorc, or ldc instruction execution, or on completion of reset exception handling. low trap instruction started by execution of a trap instruction (trapa). trap instruction exception handling requests are accepted at all times in program execution state. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 54 of 658 4.2 exception sources and exception vector table different vector addresses are assigned to different exception sources. table 4.2 lists the exception sources and their vector addresses. table 4.2 exception handling vector table exception source vector number vector address advanced mode * 1 reset 0 h'0000 to h'0003 reserved for system use 1 h'0004 to h'0007 2 h'0008 to h'000b 3 h'000c to h'000f 4 h'0010 to h'0013 trace * 4 5 h'0014 to h'0017 direct transitions * 3 6 h'0018 to h'001b external interrupt (nmi) 7 h'001c to h'001f trap instruction (four sources) 8 h'0020 to h'0023 9 h'0024 to h'0027 10 h'0028 to h'002b 11 h'002c to h'002f reserved for system use 12 h'0030 to h'0033 13 h'0034 to h'0037 14 h'0038 to h'003b 15 h'003c to h'003f external interrupt irq0 16 h'0040 to h'0043 irq1 17 h'0044 to h'0047 reserved for system use 18 h'0048 to h'004b external interrupt irq3 19 h'004c to h'004f irq4 20 h'0050 to h'0053 irq5 * 4 21 h'0054 to h'0057
rev. 2.0, 09/02, page 55 of 658 exception source vector number vector address advanced mode * 1 reserved for system use 22 h'0058 to h'005b 23 h'005c to h'005f internal interrupt * 2 24 ? 107 h'0060 to h'0063 ? h'01ac to h'01af external interrupt wkp0 to wkp7 108 h'01b0 to h'01b3 internal interrupt 120 ? 123 h'01e0 to h'01e3 ? h'01ec to h'01ef notes: 1. lower 16 bits of the address. 2. for details of internal interrupt vectors, see section 5.4.3, interrupt exception handling vector table. 3. for details on direct transitions, see section 22.10, direct transitions. 4. supported only by the h8s/2268 series. 4.3 reset a reset has the highest exception priority. when the res pin goes low, all processing halts and this lsi enters the reset. a reset initializes the internal state of the cpu and the registers of on-chip peripheral modules. the interrupt control mode is 0 immediately after reset. when the res pin goes high from the low state, this lsi starts reset exception handling. the chip can also be reset by overflow of the watchdog timer. for details see section 12, watchdog timer. 4.3.1 reset exception handling when the res pin goes low, this lsi enters the reset. to ensure that this lsi is reset, hold the res pin low for at least 20 ms at power-up. to reset the chip during operation, hold the res pin low for at least 20 states. when the res pin goes high after being held low for the necessary time, this lsi starts reset exception handling as follows. see section 23, power-on reset circuit for the reset sequence when the power-on reset circuit is enabled in the h8s/2264 series. 1. the internal state of the cpu and the registers of the on-chip peripheral modules are initialized, the t bit in exr* is cleared to 0, and the i bits in exr* and ccr is set to 1. 2. the reset exception handling vector address is read and transferred to the pc, and program execution starts from the address indicated by the pc.
rev. 2.0, 09/02, page 56 of 658 note: supported only by the h8s/2268 series. figures 4.1 shows an example of the reset sequence. high vector fetch internal processing prefetch of first program instruction (1)(3) reset exception handling vector address(when reset, (1)=h'000000, (3)=h'000002) (2)(4) start address (contents of reset exception handling vector address) (5) start address ((5)=(2)(4)) (6) first program instruction internal address bus internal read signal internal write signal internal data bus (1) (2) (4) (6) (3) (5) figure 4.1 reset sequence (advanced mode with on-chip rom enabled) 4.3.2 interrupts after reset if an interrupt is accepted after a reset and before the stack pointer (sp) is initialized, the pc and ccr will not be saved correctly, leading to a program crash. to prevent this, all interrupt requests, including nmi, are disabled immediately after a reset. since the first instruction of a program is always executed immediately after the reset state ends, make sure that this instruction initializes the stack pointer (example: mov.l #xx: sp). 4.3.3 state of on-chip peripheral modules after reset release after reset release, mstpcra is initialized to h?3f, mstpcrb to mstpcrd are initialized to h'ff, and all modules except the dtc (only for the h8s/2268 series) enter module stop mode. consequently, on-chip peripheral module registers cannot be read or written to. register reading and writing is enabled when the module stop mode is exited.
rev. 2.0, 09/02, page 57 of 658 4.4 traces (supported only by the h8s/2268 series) traces are enabled in interrupt control mode 2. trace mode is not activated in interrupt control mode 0, irrespective of the state of the t bit. for details of interrupt control modes, see section 5, interrupt controller. if the t bit in exr is set to 1, trace mode is activated. in trace mode, a trace exception occurs on completion of each instruction. trace mode is not affected by interrupt masking. table 4.3 shows the state of ccr and exr after execution of trace exception handling. trace mode is canceled by clearing the t bit in exr to 0. interrupts are accepted even within the trace exception handling routine. the t bit saved on the stack retains its value of 1, and when control is returned from the trace exception handling routine by the rte instruction, trace mode resumes. trace exception handling is not carried out after execution of the rte instruction. table 4.3 status of ccr and exr after trace exception handling ccr exr interrupt control mode i ui i2 to i0 t 0 trace exception handling cannot be used. 21??0 legend: 1: set to 1 0: cleared to 0 ?: retains value prior to execution 4.5 interrupts interrupts are controlled by the interrupt controller. the interrupt controller of the h8s/2268 series has two interrupt control modes and can assign interrupts other than nmi to eight priority/mask levels to enable multiplexed interrupt control. for details, refer to section 5, interrupt controller. interrupt exception handling is conducted as follows: 1. the values in the program counter (pc), condition code register ( ccr), and extended control register (exr)* are saved to the stack. 2. the interrupt mask bit is updated and the t bit* is cleared to 0. 3. a vector address corresponding to the interrupt source is generated, the start address is loaded from the vector table to the pc, and program execution begins from that address. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 58 of 658 4.6 trap instruction trap instruction exception handling starts when a trapa instruction is executed. trap instruction exception handling can be executed at all times in the program execution state. trap instruction exception handling is conducted as follows: 1. the values in the program counter (pc), condition code register ( ccr), and extended control register (exr)* are saved to the stack. 2. the interrupt mask bit is updated and the t bit* is cleared. 3. a vector address corresponding to the interrupt source is generated, the start address is loaded from the vector table to the pc, and program execution starts from that address. the trapa instruction fetches a start address from a vector table entry corresponding to a vector number from 0 to 3, as specified in the instruction code. table 4.4 shows the status of ccr and exr* after execution of trap instruction exception handling. table 4.4 status of ccr and exr* after trap instruction exception handling ccr exr * interrupt control mode i ui i2 to i0 t 01??? 2 * 1? ?0 legend: 1: set to 1 0: cleared to 0 ?: retains value prior to execution note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 59 of 658 4.7 stack status after exception handling figures 4.2 shows the stack after completion of trap instruction exception handling and interrupt exception handling. ccr pc (24 bit) sp note: 1. ignored on return 2. supported only by the h8s/2268 series. exr reserved * 1 pc (24 bit) sp interrupt control mode 0 interrupt control mode * 2 figure 4.2 stack status after exception handling (advanced mode) 4.8 usage note when accessing word data or longword data, this lsi assumes that the lowest address bit is 0. the stack should always be accessed by word transfer instruction or longword transfer instruction, and the value of the stack pointer (sp, er7) should always be kept even. use the following instructions to save registers: push.w rn (or mov.w rn, @-sp) push.l ern (or mov.l ern, @-sp) use the following instructions to restore registers: pop.w rn (or mov.w @sp+, rn) pop.l ern (or mov.l @sp+, ern) setting sp to an odd value may lead to a malfunction. figure 4.3 shows an example of what happens when the sp value is odd.
rev. 2.0, 09/02, page 60 of 658 sp h'fffefa h'fffefb h'fffefc h'fffefd h'fffeff r1l pc sp ccr pc sp ccr : pc : r1l : sp : condition code register program counter general register r1l stack pointer trap instruction executed sp set to h'fffeff data saved above sp mov.b r1l, @-er7 executed contents of ccr lost legend note: this diagram illustrates an example in which the interrupt control mode is 0, in advanced mode. figure 4.3 operation when sp value is odd
rev. 2.0, 09/02, page 61 of 658 section 5 interrupt controller 5.1 features this lsi controls interrupts with the interrupt controller. the interrupt controller has the following features: ? two interrupt control modes (h8s/2268 series only) ? any of two interrupt control modes can be set by means of the intm1 and intm0 bits in the system control register (syscr). ? priorities settable with ipr (h8s/2268 series only) ? an interrupt priority register (ipr) is provided for setting interrupt priorities. eight priority levels can be set for each module for all interrupts except nmi. nmi is assigned the highest priority level of 8, and can be accepted at all times. ? independent vector addresses ? all interrupt sources except wkp7 to wkp0 are assigned independent vector addresses, making it unnecessary for the source to be identified in the interrupt handling routine. ? external interrupts h8s/2268 series: 14 (nmi, irq5 to irq3, irq1, irq0, and wkp7 to wkp0) h8s/2264 series: 13 (nmi, irq4, irq3, irq1, irq0, and wkp7 to wkp0) ? nmi is the highest-priority interrupt, and is accepted at all times. rising edge or falling edge can be selected for nmi. falling edge, rising edge, or both edge detection, or level sensing, can be independently selected for irq5 to irq3, irq1, and irq0. wkp7 to wkp0 are accepted at a falling edge ? dtc control (h8s/2268 series only) ? the dtc can be activated by an interrupt request. a block diagram of the interrupt controller for the h8s/2268 series is shown in figure 5.1, and that for the h8s/2264 series is shown in figure 5.2
rev. 2.0, 09/02, page 62 of 658 syscr nmi input irq input internal interrupt request swdtend to tei2 nmieg intm1, intm0 nmi input unit irq input unit isr iscr ier ipr interrupt controller priority determination interrupt request vector number i i2 to i0 ccr exr cpu iscr ier isr ienr1 iwpr ipr syscr : irq sense control register : irq enable register : irq status register : interrupt enable register1 : wakeup interrupt request register : interrupt priority register : system control register legend ienr1 wkp input wkp input unit iwpr figure 5.1 block diagram of interrupt controller for h8s/2268 series
rev. 2.0, 09/02, page 63 of 658 syscr nmi input irq input internal interrupt request wovi0 to tei2 nmieg intm1, intm0 nmi input unit irq input unit isr iscr ier interrupt controller priority determination interrupt request vector number i ccr cpu iscr ier isr ienr1 iwpr syscr : irq sense control register : irq enable register : irq status register : interrupt enable register1 : wakeup interrupt request register : system control register legend ienr1 wkp input wkp input unit iwpr figure 5.2 block diagram of interrupt controller for h8s/2264 series
rev. 2.0, 09/02, page 64 of 658 5.2 input/output pins table 5.1 summarizes the pins of the interrupt controller. table 5.1 pin configuration name i/o function nmi input nonmaskable external interrupt rising or falling edge can be selected irq5 * irq4 irq3 irq2 irq1 irq0 input input input input input input maskable external interrupts rising, falling, or both edges, or level sensing, can be selected wkp7 wkp6 wkp5 wkp4 wkp3 wkp2 wkp1 wkp0 input input input input input input input input maskable external interrupts accepted at a falling edge note: * supported only by the h8s/2268 series. 5.3 register descriptions the interrupt controller has the following registers. ? system control register (syscr) ? irq sense control register h (iscrh) ? irq sense control register l (iscrl) ? irq enable register (ier) ? irq status register (isr) ? interrupt priority register a (ipra)* ? interrupt priority register b (iprb)* ? interrupt priority register c (iprc)* ? interrupt priority register d (iprd)* ? interrupt priority register e (ipre)*
rev. 2.0, 09/02, page 65 of 658 ? interrupt priority register f (iprf)* ? interrupt priority register g (iprg)* ? interrupt priority register i (ipri)* ? interrupt priority register j (iprj)* ? interrupt priority register k (iprk)* ? interrupt priority register l (iprl)* ? interrupt priority register m (iprm)* ? interrupt priority register o (ipro)* ? wakeup interrupt request register (iwpr) ? interrupt enable register 1 (ienr1) note:* supported only by the h8s/2268 series. 5.3.1 system control register (syscr) syscr selects the interrupt control mode and the detected edge for nmi.
rev. 2.0, 09/02, page 66 of 658 bit bit name initial value r/w descriptions 7 ? 0r/wreserved the write value should always be 0. 6 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 5 4 intm1 intm0 0 0 r/w r/w interrupt control mode 1 and 0 h8s/2268 series: these bits select the control mode of the interrupt controller. 00: interrupt control mode 0 (interrupts are controlled by the i bit.) 01: setting prohibited 10: interrupt control mode 2 (interrupts are controlled by the i2 to i0 bits and ipr.) 11: setting prohibited h8s/2264 series: the write value should always be 0. 00: interrupt control mode 0 (interrupts are controlled by the i bit.) 01: setting prohibited 10: setting prohibited 11: setting prohibited 3 nmieg 0 r/w nmi edge select selects the valid edge of the nmi interrupt input. 0: an interrupt is requested at the falling edge of nmi input 1: an interrupt is requested at the rising edge of nmi input 2 ? 0r/wreserved the write value should always be 0. 1 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 0 ? 1r/wreserved the write value should always be 0.
rev. 2.0, 09/02, page 67 of 658 5.3.2 interrupt priority registers a to g, i to m, and o (ipra to iprg, ipri to iprm, ipro) (h8s/2268 series only) the ipr registers are thirteen 8-bit readable/writable registers that set priorities (levels 7 to 0) for interrupts other than nmi. the correspondence between interrupt sources and ipr settings is shown in table 5.2. setting a value in the range from h'0 to h'7 in the 3-bit groups of bits 0 to 2 and 4 to 6 sets the priority of the corresponding interrupt. bit bit name initial value r/w description 7 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 6 5 4 ipr6 ipr5 ipr4 1 1 1 r/w r/w r/w sets the priority of the corresponding interrupt source 000: priority level 0 (lowest) 001: priority level 1 010: priority level 2 011: priority level 3 100: priority level 4 101: priority level 5 110: priority level 6 111: priority level 7 (highest) 3 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 2 1 0 ipr2 ipr1 ipr0 1 1 1 r/w r/w r/w sets the priority of the corresponding interrupt source. 000: priority level 0 (lowest) 001: priority level 1 010: priority level 2 011: priority level 3 100: priority level 4 101: priority level 5 110: priority level 6 111: priority level 7 (highest)
rev. 2.0, 09/02, page 68 of 658 5.3.3 irq enable register (ier) ier controls the enabling and disabling of interrupt requests irqn (h8s/2268 series: n = 5 to 3, 1, 0; h8s/2264 series: n = 4, 3, 1, 0). bit bit name initial value r/w description 7, 6 ? all 0 r/w reserved the write value should always be 0. 5 irq5e 0 r/w h8s/2268 series: irq5 enable the irq5 interrupt request is enabled when this bit is 1. h8s/2264 series: reserved the write value should always be 0. 4 irq4e 0 r/w irq4 enable the irq4 interrupt request is enabled when this bit is 1. 3 irq3e 0 r/w irq3 enable the irq3 interrupt request is enabled when this bit is 1. 2 ? 0r/wreserved the write value should always be 0. 1 irq1e 0 r/w irq1 enable the irq1 interrupt request is enabled when this bit is 1. 0 irq0e 0 r/w irq0 enable the irq0 interrupt request is enabled when this bit is 1.
rev. 2.0, 09/02, page 69 of 658 5.3.4 irq sense control registers h and l (iscrh and iscrl) the iscr registers select the source that generates an interrupt request at pins irqn (h8s/2268 series: n = 5 to 3, 1, 0; h8s/2264 series: n = 4, 3, 1, 0). specifiable sources are the falling edge, rising edge, or both edge detection, and level sensing. bit bit name initial value r/w description 15 to 12 ? all 0 r/w reserved the write value should always be 0. 11 10 irq5scb irq5sca 0 0 r/w r/w h8s/2268 series: irq5 sense control b irq5 sense control a 00: interrupt request generated at irq5 input level low 01: interrupt request generated at falling edge of irq5 input 10: interrupt request generated at rising edge of irq5 input 11: interrupt request generated at both falling and rising edges of irq5 input h8s/2264 series: reserved the write value should always be 0. 9 8 irq4scb irq4sca 0 0 r/w r/w irq4 sense control b irq4 sense control a 00: interrupt request generated at irq4 input level low 01: interrupt request generated at falling edge of irq4 input 10: interrupt request generated at rising edge of irq4 input 11: interrupt request generated at both falling and rising edges of irq4 input
rev. 2.0, 09/02, page 70 of 658 bit bit name initial value r/w description 7 6 irq3scb irq3sca 0 0 r/w r/w irq3 sense control b irq3 sense control a 00: interrupt request generated at irq3 input level low 01: interrupt request generated at falling edge of irq3 input 10: interrupt request generated at rising edge of irq3 input 11: interrupt request generated at both falling and rising edges of irq3 input 5, 4 ? all 0 r/w reserved the write value should always be 0. 3 2 irq1scb irq1sca 0 0 r/w r/w irq1 sense control b irq1 sense control a 00: interrupt request generated at irq1 input level low 01: interrupt request generated at falling edge of irq1 input 10: interrupt request generated at rising edge of irq1 input 11: interrupt request generated at both falling and rising edges of irq1 input 1 0 irq0scb irq0sca 0 0 r/w r/w irq0 sense control b irq0 sense control a 00: interrupt request generated at irq0 input level low 01: interrupt request generated at falling edge of irq0 input 10: interrupt request generated at rising edge of irq0 input 11: interrupt request generated at both falling and rising edges of irq0 input
rev. 2.0, 09/02, page 71 of 658 5.3.5 irq status register (isr) isr indicates the status of irqn (h8s/2268 series: n = 5 to 3, 1, 0; h8s/2264 series: n = 4, 3, 1, 0) interrupt requests. bit bit name initial value r/w description 7, 6 ? all 0 r/w reserved the write value should always be 0. 5irq5f0 r/(w) * 1 h8s/2268 series: irq5 flag indicates the status of an irq5 interrupt request. [setting condition] when the interrupt source selected by the iscr registers occurs [clearing conditions] cleared by reading irq5f flag when irq5f = 1, then writing 0 to irq5f flag when interrupt exception handling is executed when low-level detection is set and irq5 input is high level when irq5 interrupt exception handling is executed when falling, rising, or both-edge detection is set when the dtc is activated by an irq5 interrupt, and the disel bit in mrb of the dtc is cleared to 0 h8s/2264 series: reserved the write value should always be 0.
rev. 2.0, 09/02, page 72 of 658 bit bit name initial value r/w description 4 3 irq4f irq3f 0 0 r/(w) * 2 r/(w) * 2 irq4 and irq3 flags indicate the status of irq4 and irq3 interrupt requests. [setting condition] when the interrupt source selected by the iscr registers occurs [clearing conditions] cleared by reading irqnf flag when irqnf = 1, then writing 0 to irqnf flag when interrupt exception handling is executed when low-level detection is set and irqn input is high when irqn interrupt exception handling is executed when falling, rising, or both-edge detection is set when the dtc is activated by an irqn interrupt, and the disel bit in mrb of the dtc is cleared to 0 (h8s/2268 series only) 2 ? 0r/wreserved the write value should always be 0. 1 0 irq1f irq0f 0 0 r/(w) * 2 r/(w) * 2 irq1 and irq0 flags indicate the status of irq1 and irq0 interrupt requests. [setting condition] when the interrupt source selected by the iscr registers occurs [clearing conditions] cleared by reading irqnf flag when irqnf = 1, then writing 0 to irqnf flag when interrupt exception handling is executed when low-level detection is set and irqn input is high when irqn interrupt exception handling is executed when falling, rising, or both-edge detection is set when the dtc is activated by an irqn interrupt, and the disel bit in mrb of the dtc is cleared to 0 (h8s/2268 series only) notes: 1. in the h8s/2268 series, only 0 can be written to this bit to clear the flag. in the h8s/2264 series, this bit is readable/writable. 2. only 0 can be written to this bit to clear the flag.
rev. 2.0, 09/02, page 73 of 658 5.3.6 wakeup interrupt request register (iwpr) iwpr indicates the status of wkp7 to wkp0 interrupt requests. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 iwpf7 iwpf6 iwpf5 iwpf4 iwpf3 iwpf2 iwpf1 iwpf0 0 0 0 0 0 0 0 0 r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * wakeup interrupt request flags indicate the status of wkp7 to wkp0 interrupt requests. [setting condition] when wkp7 to wkp0 pins are set as wakeup inputs and these pins have a falling edge. [clearing condition] when this bit reads 1 and then write 0. note: only 0 can be written to this bit to clear the flag. 5.3.7 interrupt enable register 1 (ienr1) ienr1 enables/disables wakeup interrupt requests. bit bit name initial value r/w description 7 ienwp 0 r/w wakeup interrupt enable enables/disables wkp7 to wkp0 interrupt requests 0: wkp7 to wkp0 pin interrupt requests are disabled. 1: wkp7 to wkp0 pin interrupt requests are enabled. 6 to 1 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 0 ? 0r/wreserved this bit should always be 0 when it is read.
rev. 2.0, 09/02, page 74 of 658 5.4 interrupt sources 5.4.1 external interrupts there are 14 external interrupts for the h8s/2268 series: nmi, irq5 to irq3, irq1, irq0, and wkp7 to wkp0, and 13 external interrupts for the h8s/2264 series: nmi, irq4, irq3, irq1, irq0, and wkp7 to wkp0. these interrupts can be used to restore this lsi from software standby mode. nmi interrupt: nmi is the highest-priority interrupt, and is always accepted by the cpu regardless of the interrupt control mode or the status of the cpu interrupt mask bits. the nmieg bit in syscr can be used to select whether an interrupt is requested at a rising edge or a falling edge on the nmi pin. irqn interrupts (h8s/2268 series: n = 5 to 3, 1 and 0; h8s/2264 series: n = 4, 3, 1 and 0): irqn interrupts are requested by an input signal at irqn pins. irqn interrupts have the following features: ? using iscr, it is possible to select whether an interrupt is generated by a low level, falling edge, rising edge, or both edges, at irqn pins. ? enabling or disabling of irqn interrupt requests can be selected with ier. ? the interrupt priority level can be set with ipr. (h8s/2268 series only) ? the status of irqn interrupt requests is indicated in isr. isr flags can be cleared to 0 by software. a block diagram of irqn interrupts is shown in figure 5.3. irqn interrupt request irqne irqnf s r q clear signal edge / level detection circuit irqnsca, irqnscb input note: h8s/2268 series: n = 5 to 3, 1, 0 h8s/2264 series: n = 4, 3, 1, 0 figure 5.3 block diagram of irqn interrupts
rev. 2.0, 09/02, page 75 of 658 the set timing for irqnf is shown in figure 5.4. input pin irqnf note: h8s/2268 series: n = 5 to 3, 1, 0 h8s/2264 series: n = 4, 3, 1, 0 figure 5.4 set timing for irqnf the detection of irqn interrupts does not depend on whether the relevant pin has been set for input or output. however, when a pin is used as an external interrupt input pin, do not clear the corresponding ddr to 0; and use the pin as an i/o pin for another function. irqnf interrupt request flag is set to 1 when the setting condition is satisfied, regardless of ier settings. accordingly, refer to only necessary flags. wkp7 to wkp0 interrupts: wkp7 to wkp0 interrupts are requested by falling edge input signal at wkp7 to wkp0 pins. wkp7 to wkp0 interrupts have the following features: ? wpcr selects whether the pjn/ wkpn /segn+1 pin is used as the pjn pin or wkpn pin when the pjn/ wkpn /segn+1 pin is not used as the segn+1 pin. (n=7 to 0) for pin switching, see 9.8.5 wakeup control register (wpcr). ? ienr1 can be used to select enabling or disabling of wkp7 to wkp0 interrupt requests. ? ipr sets the interrupt priority level. (h8s/2268 series only) ? iwpr indicates the status of wkp7 to wkp0 interrupt requests. iwpr flag can be cleared to 0 by software. the block diagram of interrupts wkp7 to wkp0 is shown in figure 5.5.
rev. 2.0, 09/02, page 76 of 658 wkp7 to wkp0 iwpf7 ienwp s r q iwpf6 s r q iwpf0 s r q input - - - - - - - - - - - - - - - - - - - - clear signal falling edge detection circuit falling edge detection circuit falling edge detection circuit interrupt request input input figure 5.5 block diagram of interrupts wkp7 to wkp0 figure 5.6 shows the iwpfn setting timing. input iwpfn (n = 7 to 0) figure 5.6 iwpfn setting timing the vector number for the wkp7 to wkp0 interrupt exception handling is 108. eight interrupt pins are assigned to one vector number. accordingly, determine the source using an exception handling routine.
rev. 2.0, 09/02, page 77 of 658 the detection of interrupts wkp7 to wkp0 does not depend on whether the relevant pin has been set for input or output. however, when a pin is used as an external interrupt input pin, do not clear the corresponding ddr to 0; and use the pin as an i/o pin for another function. irqnf interrupt request flag is set to 1 when the setting condition is satisfied, regardless of ier settings. accordingly, refer to only necessary flags. 5.4.2 internal interrupts for each on-chip peripheral module, there are flags that indicate the interrupt request status, and enable bits that select enabling or disabling of these interrupts. if both of these are set to 1 for a particular interrupt source, an interrupt request is issued to the interrupt controller. 5.4.3 interrupt exception handling vector table table 5.2 shows interrupt exception handling sources, vector addresses, and interrupt priorities. for default priorities, the lower the vector number, the higher the priority. priorities among modules can be set by means of the ipr. (h8s/2268 series only) modules set at the same priority will conform to their default priorities. priorities within a module are fixed.
rev. 2.0, 09/02, page 78 of 658 table 5.2 interrupt sources, vector addresses, and interrupt priorities vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 * 3 priority nmi 7 h'001c high external pin irq0 16 h'0040 ipra6 to ipra4 irq1 17 h'0044 ipra2 to ipra0 reserved 18 h'0048 iprb6 to iprb4 irq3 19 h'004c irq4 20 h'0050 iprb2 to iprb0 irq5 * 3 21 h'0054 reserved 22 23 h'0058 h'005c iprc6 to iprc4 dtc * 3 swdtend (completion of software initiation data transfer) 24 h'0060 iprc2 to iprc0 watchdog timer 0 wovi0 (interval timer 0) 25 h'0064 iprd6 to iprd4 pc break * 3 pc break 27 h'006c ipre6 to ipre4 a/d adi (completion of a/d conversion) 28 h'0070 ipre2 to ipre0 watchdog timer 1 wovi1 (interval timer 1) 29 h'0074 ? reserved 30 31 h'0078 h'007c tpu channel 0 * 3 tgi0a (tgr0a input capture/compare- match) 32 h'0080 iprf6 to iprf4 tgi0b (tgr0b input capture/compare- match) 33 h'0084 tgi0c (tgr0c input capture/compare- match) 34 h'0088 tgi0d(tgr0d input capture/compare- match) 35 h'008c low
rev. 2.0, 09/02, page 79 of 658 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 * 3 priority tci0v (overflow 0) 36 h'0090 high ? reserved 37 38 39 h'0094 h'0098 h'009c tpu channel 1 tgi1a (tgr1a input capture/compare- match) 40 h'00a0 iprf2 to iprf0 tgi1b (tgr1b input capture/compare- match) 41 h'00a4 tci1v (overflow 1) 42 h'00a8 tci1u (underflow 1) * 3 43 h'00ac tpu channel 2 tgi2a (tgr2a input capture/compare- match) 44 h'00b0 iprg6 to iprg4 tgi2b (tgr2b input capture/compare- match) 45 h'00b4 tci2v (overflow 2) 46 h'00b8 tci2u (underflow 2) * 3 47 h'00bc 8-bit timer channel 0 cmia0 (compare- match a0) 64 h'0100 ipri6 to ipri4 cmib0 (compare- match b0) 65 h'0104 ovi0 (overflow 0) 66 h'0108 ? reserved 67 h'010c low
rev. 2.0, 09/02, page 80 of 658 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 * 3 priority 8-bit timer channel 1 cmia1 (compare- match a1) 68 h'0110 ipri2 to ipri0 high cmib1 (compare- match b1) 69 h'0114 ovi1 (overflow 1) 70 h'0118 ? reserved 71 h'011c eri0 (receive error 0) 80 h'0140 iprj2 to iprj0 rxi0 (receive completion 0) 81 h'0144 txi0 (transmit data empty 0) 82 h'0148 sci channel 0 tei0 (transmit end 0) 83 h'014c eri1 (receive error 1) 84 h'0150 iprk6 to iprk4 sci channel 1 rxi1 (receive completion 1) 85 h'0154 txi1 (transmit data empty 1) 86 h'0158 tei1 (transmit end 1) 87 h'015c 8-bit timer channel 2 * 3 cmia2 (compare- match a2) 92 h'0170 iprl6 to iprl4 cmib2 (compare- match b2) 93 h'0174 ovi2 (overflow 2) 94 h'0178 ? reserved 95 h'017c low
rev. 2.0, 09/02, page 81 of 658 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 * 3 priority 8-bit timer channel 3 * 3 cmia3 (compare- match a3) 96 h'0180 high cmib3 (compare- match b3) 97 h'0184 ovi3 (overflow 3) 98 h'0188 ? reserved 99 h'018c iic channel 0 (option) iici0 (1-byte transmission/ reception completion) 100 h'0190 reserved 101 h'0194 iprl2 to iprl0 iici1 (1-byte transmission/ reception completion) 102 h'0198 iic channel 1 * 3 (option) reserved 103 h'019c ovi4 (overflow 4) 104 h'01a0 ovi5 (overflow 5) 105 h'01a4 ovi6 (overflow 6) 106 h'01a8 8-bit reload timer channels 4 to 7 * 3 ovi7 (overflow 7) 107 h'01ac iprm6 to iprm4 external pins wkp7 to wkp0 108 h'01b0 iprm2 to iprm0 eri2 (receive error 2) 120 h'01e0 ipro6 to ipro4 rxi2 (receive completion 2) 121 h'01e4 txi2 (transmit data empty 2) 122 h'01e8 sci channel 2 tei2 (transmit end 2) 123 h'01ec low notes: 1. lower 16 bits of the start address. 2. ipr6 to ipr4, and ipr2 to ipr0 bits are reserved, because these bits have no corresponding interruption. these bits are always read as 0 and cannot be modified. 3. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 82 of 658 5.5 operation 5.5.1 interrupt control modes and interrupt operation interrupt operations in the h8s/2268 differ depending on the interrupt control mode. nmi interrupts are accepted at all times except in the reset state and the hardware standby state. in the case of irq interrupts, wkp interrupts and on-chip peripheral module interrupts, an enable bit is provided for each interrupt. clearing an enable bit to 0 disables the corresponding interrupt request. interrupt sources for which the enable bits are set to 1 are controlled by the interrupt controller. table 5.3 shows the interrupt control modes. the interrupt controller performs interrupt control according to the interrupt control mode set by the intm1 and intm0 bits in syscr, the priorities set in ipr*, and the masking state indicated by the i bit in the cpu?s ccr, and bits i2 to i0 in exr*. table 5.3 interrupt control modes interrupt syscr priority setting interrupt control mode intm1 intm0 registers * mask bits description 000 ? i interrupt mask control is performed by the i bit. ? 1 ?? setting prohibited 2 * 1 0 ipr i2 to i0 8-level interrupt mask control is performed by bits i2 to i0. 8 priority levels can be set with ipr. ? 1 ?? setting prohibited note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 83 of 658 figures 5.7 and 5.8 show block diagrams of the priority decision circuits for the h8s/2268 series and h8s/2264 series, respectively. interrupt acceptance control 8-level mask control default priority determination vector number interrupt control mode 2 ipr interrupt source i2 to i0 interrupt control mode 0 i figure 5.7 block diagram of interrupt control operation for h8s/2268 series interrupt acceptance control default priority determination vector number interrupt source interrupt control mode 0 i figure 5.8 block diagram of interrupt control operation for h8s/2264 series
rev. 2.0, 09/02, page 84 of 658 interrupt acceptance control: in interrupt control mode 0, interrupt acceptance is controlled by the i bit in ccr. table 5.4 shows the interrupts selected in each interrupt control mode. table 5.4 interrupts selected in each interrupt control mode (1) interrupt mask bits interrupt control mode i selected interrupts 0 0 all interrupts 1 nmi interrupts 2 * x all interrupts legend: x: don't care note: * supported only by the h8s/2268 series. 8-level control (h8s/2268 series only): in interrupt control mode 2, 8-level mask level determination is performed for the selected interrupts in interrupt acceptance control according to the interrupt priority level (ipr). the interrupt source selected is the interrupt with the highest priority level, and whose priority level set in ipr is higher than the mask level. table 5.5 interrupts selected in each interrupt control mode (2) interrupt control mode selected interrupts 0 all interrupts 2 highest-priority-level (ipr) interrupt whose priority level is greater than the mask level (ipr > i2 to i0). default priority determination: when an interrupt is selected by 8-level control, its priority is determined and a vector number is generated. if the same value is set for ipr, acceptance of multiple interrupts is enabled, and so only the interrupt source with the highest priority according to the preset default priorities is selected and has a vector number generated (h8s/2268 series only). interrupt sources with a lower priority than the accepted interrupt source are held pending. table 5.6 shows operations and control signal functions in each interrupt control mode.
rev. 2.0, 09/02, page 85 of 658 table 5.6 operations and control signal functions in each interrupt control mode interrupt control setting interrupt acceptance control 8-level control * 3 default priority t mode intm1 intm0 i i2 to i0 * 3 ipr * 3 determination (trace) 000 o im x ?? * 2 o ? 2 * 3 10 x ? * 1 o im pr o t legend o : interrupt operation control performed x : no operation. (all interrupts enabled) im : used as interrupt mask bit pr : sets priority. ? : not used. notes: 1. set to 1 when interrupt is accepted. 2. keep the initial setting. 3. supported only by the h8s/2268 series. 5.5.2 interrupt control mode 0 enabling and disabling of irq interrupts, wkp interrupts and on-chip peripheral module interrupts can be set by means of the i bit in the cpu?s ccr. interrupts are enabled when the i bit is cleared to 0, and disabled when set to 1. figure 5.9 shows a flowchart of the interrupt acceptance operation in this case. 1. if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. 2. if the i bit is set to 1, only an nmi interrupt is accepted, and other interrupt requests are held pending. if the i bit is cleared, an interrupt request is accepted. 3. interrupt requests are sent to the interrupt controller, the highest-ranked interrupt according to the priority system is accepted, and other interrupt requests are held pending. 4. when the cpu accepts an interrupt request, it starts interrupt exception handling after execution of the current instruction has been completed. 5. the pc and ccr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruction to be executed after returning from the interrupt handling routine. 6. next, the i bit in ccr is set to 1. this masks all interrupts except nmi. 7. the cpu generates a vector address for the accepted interrupt and starts execution of the interrupt handling routine at the address indicated by the contents of the vector address in the vector table.
rev. 2.0, 09/02, page 86 of 658 yes program execution status interrupt generated nmi irq1 irq0 save pc and ccr i=1 read vector address branch to interrupt handling routine hold pending tei2 yes yes no yes yes yes no no no i=0 no figure 5.9 flowchart of procedure up to interrupt acceptance in interrupt control mode 0
rev. 2.0, 09/02, page 87 of 658 5.5.3 interrupt control mode 2 (h8s/2268 series only) eight-level masking is implemented for irq interrupts, wkp interrupts and on-chip peripheral module interrupts by comparing the interrupt mask level set by bits i2 to i0 of exr in the cpu with ipr. figure 5.10 shows a flowchart of the interrupt acceptance operation in this case. 1. if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. 2. when interrupt requests are sent to the interrupt controller, the interrupt with the highest priority according to the interrupt priority levels set in ipr is selected, and lower-priority interrupt requests are held pending. if a number of interrupt requests with the same priority are generated at the same time, the interrupt request with the highest priority according to the priority system shown in table 5.2 is selected. 3. next, the priority of the selected interrupt request is compared with the interrupt mask level set in exr. an interrupt request with a priority no higher than the mask level set at that time is held pending, and only an interrupt request with a priority higher than the interrupt mask level is accepted. 4. when the cpu accepts an interrupt request, it starts interrupt exception handling after execution of the current instruction has been completed. 5. the pc, ccr, and exr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruction to be executed after returning from the interrupt handling routine. 6. the t bit in exr is cleared to 0. the interrupt mask level is rewritten with the priority level of the accepted interrupt. if the accepted interrupt is nmi, the interrupt mask level is set to h'7. 7. the cpu generates a vector address for the accepted interrupt and starts execution of the interrupt handling routine at the address indicated by the contents of the vector address in the vector table.
rev. 2.0, 09/02, page 88 of 658 yes program execution status interrupt generated? nmi level 6 interrupt? mask level 5 or below? level 7 interrupt? mask level 6 or below? save pc, ccr, and exr clear t bit to 0 update mask level read vector address branch to interrupt handling routine hold pending level 1 interrupt? mask level 0? yes yes no yes yes yes no yes yes no no no no no no figure 5.10 flowchart of procedure up to interrupt acceptance in control mode 2 5.5.4 interrupt exception handling sequence figure 5.11 shows the interrupt exception handling sequence. the example shown is for the case where interrupt control mode 0 is set in advanced mode, and the program area and stack area are in on-chip memory.
rev. 2.0, 09/02, page 89 of 658 (14) (12) (10) (6) (4) (2) (1) (5) (7) (9) (11) (13) interrupt service routine instruction prefetch internal operation vector fetch stack instruction prefetch internal operation interrupt acceptance interrupt level determination wait for end of instruction interrupt request signal internal address bus internal read signal internal write signal internal data bus (3) (1) (2) (4) (3) (5) (7) instruction prefetch address (not executed. this is the contents of the saved pc, the return address.) instruction code (not executed.) instruction prefetch address (not executed.) sp-2 sp-4 saved pc and saved ccr vector address interrupt handling routine start address (vector address contents) interrupt handling routine start address ((13) = (10)(12)) first instruction of interrupt handling routine (6) (8) (9) (11) (10) (12) (13) (14) (8) figure 5.11 interrupt exception handling
rev. 2.0, 09/02, page 90 of 658 5.5.5 interrupt response times this lsi is capable of fast word transfer to on-chip memory, has the program area in on-chip rom and the stack area in on-chip ram, enabling high-speed processing. table 5.7 shows interrupt response times - the interval between generation of an interrupt request and execution of the first instruction in the interrupt handling routine. the execution status symbols used in table 5.7 are explained in table 5.8. table 5.7 interrupt response times (states) normal mode * 5 advanced mode no. execution status intm1 = 0 intm1 = 1 intm1 = 0 intm1 = 1 1 interrupt priority determination * 1 33 33 2 number of wait states until executing instruction ends * 2 1 to 19 + 2s i 1 to 19 + 2s i 1 to 19 + 2s i 1 to 19 + 2s i 3 pc, ccr, exr stack save 2s k 3s k 2s k 3s k 4 vector fetch s i s i 2s i 2s i 5 instruction fetch * 3 2s i 2s i 2s i 2s i 6 internal processing * 4 22 22 total (using on-chip memory) 11 to 31 12 to 32 12 to 32 13 to 33 notes: 1. two states in case of internal interrupt. 2. refers to mulxs and divxs instructions. 3. prefetch after interrupt acceptance and interrupt handling routine prefetch. 4. internal processing after interrupt acceptance and internal processing after vector fetch. 5. not available in this lsi. table 5.8 number of states in interrupt handling routine execution status object of access external device * 8 bit bus 16 bit bus symbol internal memory 2-state access 3-state access 2-state access 3-state access instruction fetch s i 146 + 2m23 + m branch address read s j stack manipulation s k legend m : number of wait states in an external device access. note: * cannot be used in this lsi.
rev. 2.0, 09/02, page 91 of 658 5.5.6 dtc activation by interrupt (h8s/2268 series only) the dtc can be activated by an interrupt. for details, see section 8, data transfer controller (dtc). 5.6 usage notes 5.6.1 contention between interrupt generation and disabling when an interrupt enable bit is cleared to 0 to disable interrupts, the disabling becomes effective after execution of the instruction. when an interrupt enable bit is cleared to 0 by an instruction such as bclr or mov, and if an interrupt is generated during execution of the instruction, the interrupt concerned will still be enabled on completion of the instruction, and so interrupt exception handling for that interrupt will be executed on completion of the instruction. however, if there is an interrupt request of higher priority than that interrupt, interrupt exception handling will be executed for the higher-priority interrupt, and the lower-priority interrupt will be ignored. the same also applies when an interrupt source flag is cleared to 0. figure 5.12 shows an example in which the cmiea bit in the tcr register of the 8-bit timer is cleared to 0. internal address bus internal write signal cmiea cmfa cmia interrupt signal tcr write cycle by cpu cmia exception handling tcr address figure 5.12 contention between interrupt generation and disabling
rev. 2.0, 09/02, page 92 of 658 the above contention will not occur if an enable bit or interrupt source flag is cleared to 0 while the interrupt is masked. 5.6.2 instructions that disable interrupts the instructions that disable interrupts are ldc, andc, orc, and xorc. after any of these instructions are executed, all interrupts including nmi are disabled and the next instruction is always executed. when the i bit is set by one of these instructions, the new value becomes valid two states after execution of the instruction ends. 5.6.3 when interrupts are disabled there are times when interrupt acceptance is disabled by the interrupt controller. the interrupt controller disables interrupt acceptance for a 3-state period after the cpu has updated the mask level with an ldc, andc, orc, or xorc instruction. 5.6.4 interrupts during execution of eepmov instruction interrupt operation differs between the eepmov.b instruction and the eepmov.w instruction. with the eepmov.b instruction, an interrupt request (including nmi) issued during the transfer is not accepted until the move is completed. with the eepmov.w instruction, if an interrupt request is issued during the transfer, interrupt exception handling starts at a break in the transfer cycle. the pc value saved on the stack in this case is the address of the next instruction. therefore, if an interrupt is generated during execution of an eepmov.w instruction, the following coding should be used. l1: eepmov.w mov.w r4,r4 bne l1
rev. 2.0, 09/02, page 93 of 658 section 6 pc break controller (pbc) the h8s/2268 series includes a pc break controller (pbc), while the h8s/2264 series does not. the pc break controller (pbc) provides functions that simplify program debugging. using these functions, it is easy to create a self-monitoring debugger, enabling programs to be debugged with the chip alone, without using an in-circuit emulator. a block diagram of the pc break controller is shown in figure 6.1. 6.1 features ? two break channels (a and b) ? 24-bit break address ? bit masking possible ? four types of break compare conditions ? instruction fetch ? data read ? data write ? data read/write ? bus master ? either cpu or cpu/dtc can be selected ? the timing of pc break exception handling after the occurrence of a break condition is as follows: ? immediately before execution of the instruction fetched at the set address (instruction fetch) ? immediately after execution of the instruction that accesses data at the set address (data access) ? module stop mode can be set pbc0000b_000020020700
rev. 2.0, 09/02, page 94 of 658 output control output control mask control pc break interrupt match signal mask control bara bcra barb bcrb comparator control logic comparator control logic internal address access status match signal figure 6.1 block diagram of pc break controller 6.2 register descriptions the pc break controller has the following registers. ? break address register a (bara) ? break address register b (barb) ? break control register a (bcra) ? break control register b (bcrb) 6.2.1 break address register a (bara) bara is a 32-bit readable/writable register that specifies the channel a break address. bit bit name initial value r/w description 31 to 24 ? undefined ? reserved these bits are read as an undefined value and cannot be modified. 23 to 0 baa23 to baa0 h'000000 r/w these bits set the channel a pc break address. 6.2.2 break address register b (barb) barb is the channel b break address register. the bit configuration is the same as for bara.
rev. 2.0, 09/02, page 95 of 658 6.2.3 break control register a (bcra) bcra controls channel a pc breaks. bit bit name initial value r/w description 7cmfa 0 r/(w) * 1 condition match flag a [setting condition] when a condition set for channel a is satisfied [clearing condition] when 0 is written to cmfa after reading * 2 cmfa = 1 6 cda 0 r/w cpu cycle/dtc cycle select a selects the channel a break condition bus master. 0: cpu 1: cpu or dtc 5 4 3 bamra2 bamra1 bamra0 0 0 0 r/w r/w r/w break address mask register a2 to a0 these bits specify which bits of the break address set in bara are to be masked. 000: baa23?0 (all bits are unmasked) 001: baa23?1 (lowest bit is masked) 010: baa23?2 (lower 2 bits are masked) 011: baa23?3 (lower 3 bits are masked) 100: baa23?4 (lower 4 bits are masked) 101: baa23?8 (lower 8 bits are masked) 110: baa23?12 (lower 12 bits are masked) 111: baa23?16 (lower 16 bits are masked) 2 1 csela1 csela0 0 0 r/w r/w break condition select selects break condition of channel a. 00: instruction fetch is used as break condition 01: data read cycle is used as break condition 10: data write cycle is used as break condition 11: data read/write cycle is used as break condition 0 biea 0 r/w break interrupt enable when this bit is 1, the pc break interrupt request of channel a is enabled. notes: 1. only a 0 can be written to this bit to clear the flag. 2. read the state wherein cmfa = 1 twice or more, when the cmfa is polled after inhibiting the pc break interruption.
rev. 2.0, 09/02, page 96 of 658 6.2.4 break control register b (bcrb) bcrb is the channel b break control register. the bit configuration is the same as for bcra. 6.3 operation the operation flow from break condition setting to pc break interrupt exception handling is shown in section 6.3.1, pc break interrupt due to instruction fetch, and 6.3.2, pc break interrupt due to data access, taking the example of channel a. 6.3.1 pc break interrupt due to instruction fetch 1. set the break address in bara. for a pc break caused by an instruction fetch, set the address of the first instruction byte as the break address. 2. set the break conditions in bcr. set bit 6 (cda) to 0 to select the cpu because the bus master must be the cpu for a pc break caused by an instruction fetch. set the address bits to be masked to bits 3 to 5 (bama2 to 0). set bits 1 and 2 (csela1 to 0) to 00 to specify an instruction fetch as the break condition. set bit 0 (biea) to 1 to enable break interrupts. 3. when the instruction at the set address is fetched, a pc break request is generated immediately before execution of the fetched instruction, and the condition match flag (cmfa) is set. 4. after priority determination by the interrupt controller, pc break interrupt exception handling is started. 6.3.2 pc break interrupt due to data access 1. set the break address in bara. for a pc break caused by a data access, set the target rom, ram, i/o, or external address space address as the break address. stack operations and branch address reads are included in data accesses. 2. set the break conditions in bcra. select the bus master with bit 6 (cda). set the address bits to be masked to bits 3 to 5 (bama2 to 0). set bits 1 and 2 (csela1 to 0) to 01, 10, or 11 to specify data access as the break condition. set bit 0 (biea) to 1 to enable break interrupts. 3. after execution of the instruction that performs a data access on the set address, a pc break request is generated and the condition match flag (cmfa) is set. 4. after priority determination by the interrupt controller, pc break interrupt exception handling is started.
rev. 2.0, 09/02, page 97 of 658 6.3.3 notes on pc break interrupt handling ? when a pc break interrupt is generated at the transfer address of an eepmov.b instruction pc break exception handling is executed after all data transfers have been completed and the eepmov.b instruction has ended. ? when a pc break interrupt is generated at a dtc transfer address pc break exception handling is executed after the dtc has completed the specified number of data transfers, or after data for which the disel bit is set to 1 has been transferred. 6.3.4 operation in transitions to power-down modes the operation when a pc break interrupt is set for an instruction fetch at the address after a sleep instruction is shown below. ? when the sleep instruction causes a transition from high-speed (medium-speed) mode to sleep mode: after execution of the sleep instruction, a transition is not made to sleep mode, and pc break interrupt handling is executed. after execution of pc break interrupt handling, the instruction at the address after the sleep instruction is executed (figure 6.2 (a)). ? when the sleep instruction causes a transition from high speed (medium speed) mode to subactive mode (figure 6.2 (b)). ? when the sleep instruction causes a transition from subactive mode to high speed (medium speed) mode (figure 6.2 (c)). ? when the sleep instruction causes a transition to software standby mode: after execution of the sleep instruction, a transition is made to the respective mode, and pc break interrupt handling is not executed. however, the cmfa or cmfb flag is set (figure 6.2 (d)).
rev. 2.0, 09/02, page 98 of 658 sleep instruction execution high-speed (medium-speed) mode sleep instruction execution subactive mode system clock subclock direct transition exception handling pc break exception handling execution of instruction after sleep instruction subclock system clock, oscillation settling time sleep instruction execution transition to respective mode direct transition exception handling pc break exception handling execution of instruction after sleep instruction pc break exception handling execution of instruction after sleep instruction (a) (b) (c) (d) sleep instruction execution figure 6.2 operation in power-down mode transitions 6.3.5 when instruction execution is delayed by one state while the break interrupt enable bit is set to 1, instruction execution is one state later than usual. ? for 1-word branch instructions (bcc d:8, bsr, jsr, jmp, trapa, rte, and rts) in on-chip rom or ram. ? when break interruption by instruction fetch is set, the set address indicates on-chip rom or ram space, and that address is used for data access, the instruction that executes the data access is one state later than in normal operation. ? when break interruption by instruction fetch is set and a break interrupt is generated, if the executing instruction immediately preceding the set instruction has one of the addressing modes shown below, and that address indicates on-chip rom or ram, the instruction will be one state later than in normal operation. addressing modes: @ern, @(d:16,ern), @(d:32,ern), @-ern/ern+, @aa:8, @aa:24, @aa:32, @(d:8,pc), @(d:16,pc), @@aa:8 ? when break interruption by instruction fetch is set and a break interrupt is generated, if the executing instruction immediately preceding the set instruction is nop or sleep, or has #xx, rn as its addressing mode, and that instruction is located in on-chip rom or ram, the instruction will be one state later than in normal operation.
rev. 2.0, 09/02, page 99 of 658 6.4 usage notes 6.4.1 module stop mode setting pbc operation can be disabled or enabled using the module stop control register. the initial setting is for pbc operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 22, power-down modes. 6.4.2 pc break interrupts the pc break interrupt is shared by channels a and b. the channel from which the request was issued must be determined by the interrupt handler. 6.4.3 cmfa and cmfb the cmfa and cmfb flags are not automatically cleared to 0, so 0 must be written to cmfa or cmfb after first reading the flag while it is set to 1. if the flag is left set to 1, another interrupt will be requested after interrupt handling ends. 6.4.4 pc break interrupt when dtc is bus master a pc break interrupt generated when the dtc is the bus master is accepted after the bus has been transferred to the cpu by the bus controller. 6.4.5 pc break set for instruction fetch at address following bsr, jsr, jmp, trapa, rte, or rts instruction when a pc break is set for an instruction fetch at an address following a bsr, jsr, jmp, trapa, rte, or rts instruction: even if the instruction at the address following a bsr, jsr, jmp, trapa, rte, or rts instruction is fetched, it is not executed, and so a pc break interrupt is not generated by the instruction fetch at the next address. 6.4.6 i bit set by ldc, andc, orc, or xorc instruction when the i bit is set by an ldc, andc, orc, or xorc instruction, a pc break interrupt becomes valid two states after the end of the executing instruction. if a pc break interrupt is set for the instruction following one of these instructions, since interrupts, including nmi, are disabled for a 3-state period in the case of ldc, andc, orc, and xor, the next instruction is always executed. for details, see section 5, interrupt controller.
rev. 2.0, 09/02, page 100 of 658 6.4.7 pc break set for instruction fetch at address following bcc instruction when a pc break is set for an instruction fetch at an address following a bcc instruction: a pc break interrupt is generated if the instruction at the next address is executed in accordance with the branch condition, and is not generated if the instruction at the next address is not executed. 6.4.8 pc break set for instruction fetch at branch destination address of bcc instruction when a pc break is set for an instruction fetch at the branch destination address of a bcc instruction: a pc break interrupt is generated if the instruction at the branch destination is executed in accordance with the branch condition, and is not generated if the instruction at the branch destination is not executed.
rev. 2.0, 09/02, page 101 of 658 section 7 bus controller the h8s/2000 cpu is driven by a system clock, denoted by the symbol . the bus controller controls a memory cycle and a bus cycle. different methods are used to access on-chip memory and on-chip peripheral modules. in the h8s/2268 series, the bus controller also has a bus arbitration function, and controls the operation of the internal bus masters: the cpu and data transfer controller (dtc). 7.1 basic timing the period from one rising edge of to the next is referred to as a "state." the memory cycle or bus cycle consists of one, two, or four states. different methods are used to access on-chip memory, on-chip peripheral modules, and the external address space. 7.1.1 on-chip memory access timing (rom, ram) on-chip memory is accessed in one state. the data bus is 16 bits wide, permitting both byte and word transfer instruction. figure 7.1 shows the on-chip memory access cycle. t1 internal address bus bus cycle address read data write data internal read signal internal data bus internal write signal internal data bus read access write access figure 7.1 on-chip memory access cycle
rev. 2.0, 09/02, page 102 of 658 7.1.2 on-chip peripheral module access timing (h'fffdac to h'ffffbf) addresses h'fffdac to h'ffffbf in the on-chip peripheral modules are accessed in two states. the data bus is either 8 bits or 16 bits wide, depending on the particular internal i/o register being accessed. for details, refer to section 25, list of registers. figure 7.2 shows access timing for the on-chip peripheral modules (h'fffdac to h'ffffbf). t1 t2 internal address bus bus cycle address read data write data internal read signal internal data bus internal write signal internal data bus read access write access figure 7.2 on-chip peripheral module access cycle (h'fffdac to h'ffffbf) 7.1.3 on-chip peripheral module access timing (h'fffc30 to h'fffca3) addresses h'fffc30 to h'fffca3 on the on-chip peripheral modules and registers are accessed in four states. the data bus is either 8 bits or 16 bits wide, depending on the particular internal i/o register being accessed. for details, refer to section 25, list of registers. figure 7.3 shows access timing for the on-chip peripheral modules (h'fffc30 to h'fffca3). the on-chip module of which address is between h'fffc30 to h'fffca3 includes lcd, dtmf* 1 , tmr4* 1 , port h to l and ports m* 1 and n* 1 . the registers are wkp register, module stop control register d and system clock control register 2* 2 . notes: 1. supported only by the h8s/2268 series. 2. supported only by the h8s/2264 series.
rev. 2.0, 09/02, page 103 of 658 internal address bus internal read signal internal data bus internal write signal internal data bus bus cycle t1 address read access write access t3 t2 t4 read data write data figure 7.3 on-chip peripheral module access cycle (h'fffc30 to h'fffca3) 7.2 bus arbitration (h8s/2268 series only) the bus controller has a bus arbiter that arbitrates bus master operations. there are two bus masters, the cpu and dtc, which perform read/write operations when they control the bus. 7.2.1 order of priority of the bus masters each bus master requests the bus by means of a bus request signal. the bus arbiter detects the bus masters? bus request signals, and if the bus is requested, sends a bus request acknowledge signal to the bus master making the request. if there are bus requests from more than one bus master, the bus request acknowledge signal is sent to the one with the highest priority. when a bus master receives the bus request acknowledge signal, it takes possession of the bus until that signal is canceled. the order of priority of the bus masters is as follows: (high) dtc > cpu (low)
rev. 2.0, 09/02, page 104 of 658 7.2.2 bus transfer timing even if a bus request is received from a bus master with a higher priority than that of the bus master that has acquired the bus and is currently operating, the bus is not necessarily transferred immediately. the cpu is the lowest-priority bus master, and if a bus request is received from the dtc, the bus arbiter transfers the bus to the bus master that issued the request. the timing for transfer of the bus is as follows: ? the bus is transferred at a break between bus cycles. however, if a bus cycle is executed in discrete operations, as in the case of a longword-size access, the bus is not transferred between such operations. for details, refer to section 2.7, bus states during instruction execution, in the h8s/2600 series, h8s/2000 series programming manual. ? if the cpu is in sleep mode, it transfers the bus immediately. the dtc sends the bus arbiter a request for the bus when an activation request is generated. 7.2.3 resets and the bus controller in a reset, the h8s/2268, including the bus controller, enters the reset state at that point, and an executing bus cycle is discontinued.
rev. 2.0, 09/02, page 105 of 658 section 8 data transfer controller (dtc) the h8s/2268 series includes a data transfer controller (dtc), while the h8s/2264 series does not. the dtc can be activated by an interrupt or software, to transfer data. figure 8.1 shows a block diagram of the dtc. the dtc?s register information is stored in the on-chip ram. when the dtc is used, the rame bit in syscr must be set to 1. a 32-bit bus connects the dtc to the on-chip ram (1 kbyte), enabling 32-bit/1-state reading and writing of the dtc register information. 8.1 features ? transfer is possible over any number of channels ? three transfer modes ? normal, repeat, and block transfer modes are available ? one activation source can trigger a number of data transfers (chain transfer) ? the direct specification of 16-mbyte address space is possible ? activation by software is possible ? transfer can be set in byte or word units ? a cpu interrupt can be requested for the interrupt that activated the dtc ? module stop mode can be set dtch808b_000020020700
rev. 2.0, 09/02, page 106 of 658 internal address bus dtcer a to dtcerf and dtceri interrupt controller interrupt request dtc on-chip ram internal data bus cpu interrupt request mra mrb cra crb dar sar mra, mrb cra, crb sar dar dtcera to dtcerf and dtceri dtvecr : dtc mode registers a and b : dtc transfer count registers a and b : dtc source address register : dtc destination address register : dtc enable registers a to f and i : dtc vector register legend dtc service request control logic register information dtvecr figure 8.1 block diagram of dtc
rev. 2.0, 09/02, page 107 of 658 8.2 register descriptions the dtc has the following registers. ? dtc mode register a (mra) ? dtc mode register b (mrb) ? dtc source address register (sar) ? dtc destination address register (dar) ? dtc transfer count register a (cra) ? dtc transfer count register b (crb) these six registers cannot be directly accessed from the cpu. when activated, the dtc reads a set of register information that is stored in on-chip ram to the corresponding dtc registers and transfers data. after the data transfer, it writes a set of updated register information back to the ram. ? dtc enable registers (dtcer) ? dtc vector register (dtvecr) 8.2.1 dtc mode register a (mra) mra selects the dtc operating mode.
rev. 2.0, 09/02, page 108 of 658 bit bit name initial value r/w description 7 6 sm1 sm0 undefined undefined ? ? source address mode 1 and 0 these bits specify an sar operation after a data transfer. 0x: sar is fixed 10: sar is incremented after a transfer (by +1 when sz = 0; by +2 when sz = 1) 11: sar is decremented after a transfer (by ?1 when sz = 0; by ?2 when sz = 1) 5 4 dm1 dm0 undefined undefined ? ? destination address mode 1 and 0 these bits specify a dar operation after a data transfer. 0x: dar is fixed 10: dar is incremented after a transfer (by +1 when sz = 0; by +2 when sz = 1) 11: dar is decremented after a transfer (by ?1 when sz = 0; by ?2 when sz = 1) 3 2 md1 md0 undefined undefined ? ? dtc mode 1 and 0 these bits specify the dtc transfer mode. 00: normal mode 01: repeat mode 10: block transfer mode 11: setting prohibited 1 dts undefined ? dtc transfer mode select specifies whether the source side or the destination side is set to be a repeat area or block area, in repeat mode or block transfer mode. 0: destination side is repeat area or block area 1: source side is repeat area or block area 0 sz undefined ? dtc data transfer size specifies the size of data to be transferred. 0: byte-size transfer 1: word-size transfer legend x: don?t care
rev. 2.0, 09/02, page 109 of 658 8.2.2 dtc mode register b (mrb) mrb is an 8-bit register that selects the dtc operating mode. bit bit name initial value r/w description 7 chne undefined ? dtc chain transfer enable this bit specifies a chain transfer. for details, refer to 8.5.4, chain transfer. in data transfer with chne set to 1, determination of the end of the specified number of transfers, clearing of the interrupt source flag, and clearing of dtcer, are not performed. 0: dtc data transfer completed (waiting for start) 1: dtc data transfer (reads new register information and transfers data) 6 disel undefined ? dtc interrupt select this bit specifies whether cpu interrupt is disabled or enabled after a data transfer. 0: interrupt request is issued to the cpu when the specified data transfer is completed. 1: dtc issues interrupt request to the cpu in every data transfer (dtc does not clear the interrupt request flag that is a cause of the activation). 5 to 0 ? undefined ? reserved these bits have no effect on dtc operation. the write value should always be 0. 8.2.3 dtc source address register (sar) sar is a 24-bit register that designates the source address of data to be transferred by the dtc. for word-size transfer, specify an even source address. 8.2.4 dtc destination address register (dar) dar is a 24-bit register that designates the destination address of data to be transferred by the dtc. for word-size transfer, specify an even destination address.
rev. 2.0, 09/02, page 110 of 658 8.2.5 dtc transfer count register a (cra) cra is a 16-bit register that designates the number of times data is to be transferred by the dtc. in normal mode, the entire cra functions as a 16-bit transfer counter (1 to 65536). it is decremented by 1 every time data is transferred, and transfer ends when the count reaches h'0000. in repeat mode or block transfer mode, the cra is divided into two parts; the upper 8 bits (crah) and the lower 8 bits (cral). crah holds the number of transfers while cral functions as an 8-bit transfer counter (1 to 256). cral is decremented by 1 every time data is transferred, and the contents of crah are sent when the count reaches h'00. 8.2.6 dtc transfer count register b (crb) crb is a 16-bit register that designates the number of times data is to be transferred by the dtc in block transfer mode. it functions as a 16-bit transfer counter (1 to 65536) that is decremented by 1 every time data is transferred, and transfer ends when the count reaches h'0000. 8.2.7 dtc enable register (dtcer) dtcer is comprised of seven registers; dtcera to dtcerf and dtceri, and is a register that specifies dtc activation interrupt sources. the correspondence between interrupt sources and dtce bits is shown in table 8.1. for dtce bit setting, use bit manipulation instructions such as bset and bclr for reading and writing. if all interrupts are masked, multiple activation sources can be set at one time (only at the initial setting) by writing data after executing a dummy read on the relevant register. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 dtce7 dtce6 dtce5 dtce4 dtce3 dtce2 dtce1 dtce0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w dtc activation enable setting this bit to 1 specifies a relevant interrupt source as a dtc activation source. [clearing conditions] when the disel bit is 1 and the data transfer has ended when the specified number of transfers have ended these bits are not cleared when the disel bit is 0 and the specified number of transfers have not been completed
rev. 2.0, 09/02, page 111 of 658 8.2.8 dtc vector register (dtvecr) dtvecr is an 8-bit readable/writable register that enables or disables dtc activation by software, and sets a vector number for the software activation interrupt. bit bit name initial value r/w description 7 swdte 0 r/w dtc software activation enable setting this bit to 1 activates dtc. only a 1 can be written to this bit. [clearing conditions] when the disel bit is 0 and the specified number of transfers have not ended when 0 s written to the disel bit after a software- activated data transfer end interrupt (swdtend) request has been sent to the cpu. when the disel bit is 1 and data transfer has ended, the specified number of transfers have ended, or software-activated data transfer is in process, this bit will not be cleared. 6 5 4 3 2 1 0 dtvec6 dtvec5 dtvec4 dtvec3 dtvec2 dtvec1 dtvec0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w dtc software activation vectors 0 to 6 these bits specify a vector number for dtc software activation. the vector address is expressed as h'0400 + (vector number 2). for example, when dtvec6 to dtvec0 = h'10, the vector address is h'0420. these bits are writable when swdte=0. 8.3 activation sources the dtc operates when activated by an interrupt or by a write to dtvecr by software. an interrupt request can be directed to the cpu or dtc, as designated by the corresponding dtcer bit. at the end of a data transfer (or the last consecutive transfer in the case of chain transfer), the activation source or corresponding dtcer bit is cleared. the activation source flag, in the case of rxi0, for example, is the rdrf flag of sci_0. when an interrupt has been designated a dtc activation source, the existing cpu mask level and interrupt controller priorities have no effect. if there is more than one activation source at the same time, the dtc operates in accordance with the default priorities. figure 8.2 shows a block diagram of activation source control. for details, see section 5, interrupt controller.
rev. 2.0, 09/02, page 112 of 658 cpu dtc dtcer source flag cleared on-chip peripheral module irq interrupt interrupt request clear clear controller clear request interrupt controller selection circuit interrupt mask select dtvecr figure 8.2 block diagram of dtc activation source control 8.4 location of register information and dtc vector table locate the register information in the on-chip ram (addresses: h'ffebc0 to h'ffefbf). register information should be located at an address that is a multiple of four within the range. locating the register information in address space is shown in figure 8.3. locate the mra, sar, mrb, dar, cra, and crb registers, in that order, from the start address of the register information. in the case of chain transfer, register information should be located in consecutive areas as shown in figure 8.3, and the register information start address should be located at the vector address corresponding to the interrupt source. figure 8.4 shows the correspondence between dtc vector address and register information. the dtc reads the start address of the register information from the vector address set for each activation source, and then reads the register information from that start address. when the dtc is activated by software, the vector address is obtained from: h'0400 + (dtvecr[6:0] 2). for example, if dtvecr is h'10, the vector address is h'0420. the configuration of the vector address is the same in both normal* and advanced modes, a 2-byte unit being used in both cases. these two bytes specify the lower bits of the register information start address. note: normal mode cannot be used in this lsi.
rev. 2.0, 09/02, page 113 of 658 mra 0123 sar mrb dar cra crb mra sar mrb dar cra crb lower address 4 bytes register information register information for 2nd transfer in chain transfer register information start address chain transfer figure 8.3 the location of the dtc register information in the address space register information start address register information chain transfer dtc vector address figure 8.4 correspondence between dtc vector address and register information
rev. 2.0, 09/02, page 114 of 658 table 8.1 interrupt sources, dtc vector addresses, and corresponding dtces interrupt source origin of interrupt source vector number dtc vector address dtce * priority software write to dtvecr dtvecr h'0400 + vector number 2 ? high external pin irq0 16 h'0420 dtcea7 irq1 17 h'0422 dtcea6 irq3 19 h'0426 dtcea4 irq4 20 h'0428 dtcea3 irq5 21 h'042a dtcea2 a/d adi (a/d conversion end) 28 h'0438 dtceb6 tgi0a 32 h'0440 dtceb5 tpu channel 0 tgi0b 33 h'0442 dtceb4 tgi0c 34 h'0444 dtceb3 tgi0d 35 h'0446 dtceb2 tgi1a 40 h'0450 dtceb1 tpu channel 1 tgi1b 41 h'0452 dtceb0 tgi2a 44 h'0458 dtcec7 tpu channel 2 tgi2b 45 h'045a dtcec6 cmia0 64 h'0480 dtced3 8-bit timer channel 0 cmib0 65 h'0482 dtced2 cmia1 68 h'0488 dtced1 8-bot timer channel 1 cmib1 69 h'048a dtced0 rxi0 81 h'04a2 dtcee3 sci channel 0 txi0 82 h'04a4 dtcee2 rxi1 85 h'04aa dtcee1 sci channel 1 txi1 86 h'04ac dtcee0 cmia2 92 h'04b8 dtcef5 8-bit timer channel 2 cmib2 93 h'04ba dtcef4 cmia3 96 h'04c0 dtcef3 8-bit timer channel 3 cmib3 97 h'04c2 dtcef2 low
rev. 2.0, 09/02, page 115 of 658 interrupt source origin of interrupt source vector number dtc vector address dtce * priority iic channel 0 (optional) iici0 100 h'04c8 dtcef1 high iic channel 1 (optional) iici1 102 h'04cc dtcef0 rxi2 121 h'04f2 dtcei7 sci channel 2 txi2 122 h'04f4 dtcei6 low note: * dtce bits with no corresponding interrupt are reserved, and should be written with 0. 8.5 operation register information is stored in on-chip ram. when activated, the dtc reads register information in on-chip ram and transfers data. after the data transfer, the dtc writes updated register information back to the memory. the pre-storage of register information in memory makes it possible to transfer data over any required number of channels. the transfer mode can be specified as normal, repeat, and block transfer mode. setting the chne bit in mrb to 1 makes it possible to perform a number of transfers with a single activation source (chain transfer). the 24-bit sar designates the dtc transfer source address, and the 24-bit dar designates the transfer destination address. after each transfer, sar and dar are independently incremented, decremented, or left fixed depending on its register information. figure 8.5 shows the flowchart of dtc operation.
rev. 2.0, 09/02, page 116 of 658 start end read dtc vector read register infomation data transfer write register information interupt exception handling clear dtcer clear an activeation flag chne 1 next transfer yes yes no transfer counter=0 or disel 1 no figure 8.5 flowchart of dtc operation 8.5.1 normal mode in normal mode, one operation transfers one byte or one word of data. from 1 to 65,536 transfers can be specified. once the specified number of transfers have been completed, a cpu interrupt can be requested. table 8.2 lists the register information in normal mode. figure 8.6 shows the memory mapping in normal mode.
rev. 2.0, 09/02, page 117 of 658 table 8.2 register information in normal mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register a cra designates transfer count dtc transfer count register b crb not used sar dar transfer figure 8.6 memory mapping in normal mode 8.5.2 repeat mode in repeat mode, one operation transfers one byte or one word of data. from 1 to 256 transfers can be specified. once the specified number of transfers have ended, the initial state of the transfer counter and the address register specified as the repeat area is restored, and transfer is repeated. in repeat mode the transfer counter value does not reach h'00, and therefore cpu interrupts cannot be requested when disel = 0. table 8.3 lists the register information in repeat mode. figure 8.7 shows the memory mapping in repeat mode.
rev. 2.0, 09/02, page 118 of 658 table 8.3 register information in repeat mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register ah crah holds number of transfers dtc transfer count register al cral designates transfer count dtc transfer count register b crb not used sar or dar dar or sar repeat area transfer figure 8.7 memory mapping in repeat mode 8.5.3 block transfer mode in block transfer mode, one operation transfers one block of data. either the transfer source or the transfer destination is designated as a block area. the block size can be between 1 to 256. when the transfer of one block ends, the initial state of the block size counter and the address register specified as the block area is restored. the other address register is then incremented, decremented, or left fixed. from 1 to 65,536 transfers can be specified. once the specified number of transfers have been completed, a cpu interrupt is requested. table 8.4 lists the register information in block transfer mode. figure 8.8 shows the memory mapping in block transfer mode.
rev. 2.0, 09/02, page 119 of 658 table 8.4 register information in block transfer mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register ah crah holds block size dtc transfer count register al cral designates block size count dtc transfer count register b crb transfer count first block transfer block area nth block dar or sar sar or dar figure 8.8 memory mapping in block transfer mode 8.5.4 chain transfer setting the chne bit in mrb to 1 enables a number of data transfers to be performed consecutively in response to a single transfer request. sar, dar, cra, crb, mra, and mrb, which define data transfers, can be set independently. figure 8.9 shows the memory map for chain transfer. when activated, the dtc reads the register information start address stored at the vector address, and then reads the first register information at that start address. after the data transfer, the chne bit will be tested. when it has been set to 1, dtc reads the next register information located in a
rev. 2.0, 09/02, page 120 of 658 consecutive area and performs the data transfer. these sequences are repeated until the chne bit is cleared to 0. in the case of transfer with chne set to 1, an interrupt request to the cpu is not generated at the end of the specified number of transfers or by setting of the disel bit to 1, and the interrupt source flag for the activation source is not affected. dtc vector address register information chne=1 register information chne=0 register information start address source destination source destination figure 8.9 chain transfer operation 8.5.5 interrupts an interrupt request is issued to the cpu when the dtc has completed the specified number of data transfers, or a data transfer for which the disel bit was set to 1. in the case of interrupt activation, the interrupt set as the activation source is generated. these interrupts to the cpu are subject to cpu mask level and interrupt controller priority level control. in the case of software activation, a software-activated data transfer end interrupt (swdtend) is generated.
rev. 2.0, 09/02, page 121 of 658 when the disel bit is 1 and one data transfer has been completed, or the specified number of transfers have been completed, after data transfer ends the swdte bit is held at 1 and an swdtend interrupt is generated. the interrupt handling routine will then clear the swdte bit to 0. when the dtc is activated by software, an swdtend interrupt is not generated during a data transfer wait or during data transfer even if the swdte bit is set to 1. 8.5.6 operation timing figure 8.10 to 8.12 show the dtc operation timings. dtc activation request dtc request address vector read read write data transfer transfer information write transfer information read figure 8.10 dtc operation timing (example in normal mode or repeat mode) dtc activation request dtc request address vector read read write read write data transfer transfer information write transfer information read figure 8.11 dtc operation timing (example of block transfer mode, with block size of 2)
rev. 2.0, 09/02, page 122 of 658 dtc activation request dtc request address vector read read write read write data transfer data transfer transfer information write transfer information write transfer information read transfer information read figure 8.12 dtc operation timing (example of chain transfer) 8.5.7 number of dtc execution states table 8.5 lists execution status for a single dtc data transfer, and table 8.6 shows the number of states required for each execution status. table 8.5 dtc execution status mode vector read i register information read/write j data read k data write l internal operations m normal1 6 113 repeat 1 6 1 1 3 block transfer 1 6 n n 3 legend: n: block size (initial setting of crah and cral)
rev. 2.0, 09/02, page 123 of 658 table 8.6 number of states required for each execution status object to be accessed on- chip ram on- chip rom internal i/o registers external devices * bus width 32168 168 16 access states 11222323 vector read s i ? 1 ?? 46 + 2m23 + m execution status register information read/write s j 1 ??????? byte data read s k 112223 + m23 + m word data read s k 114246 + 2m23 + m byte data write s l 112223 + m23 + m word data write s l 114246 + 2m23 + m internal operation s m 1 legend: m: the number of wait states for accessing external devices. note: * cannot be used in this lsi. the number of execution states is calculated from using the formula below. note that is the sum of all transfers activated by one activation event (the number in which the chne bit is set to 1, plus 1). number of execution states = i s i + (j s j + k s k + l s l ) + m s m for example, when the dtc vector address table is located in the on-chip rom, normal mode is set, and data is transferred from on-chip rom to an internal i/o register, then the time required for the dtc operation is 13 states. the time from activation to the end of the data write is 10 states. 8.6 procedures for using dtc 8.6.1 activation by interrupt the procedure for using the dtc with interrupt activation is as follows: 1. set the mra, mrb, sar, dar, cra, and crb register information in on-chip ram. 2. set the start address of the register information in the dtc vector address. 3. set the corresponding bit in dtcer to 1. 4. set the enable bits for the interrupt sources to be used as the activation sources to 1. the dtc is activated when an interrupt used as an activation source is generated.
rev. 2.0, 09/02, page 124 of 658 5. after one data transfer has been completed, or after the specified number of data transfers have been completed, the dtce bit is cleared to 0 and a cpu interrupt is requested. if the dtc is to continue transferring data, set the dtce bit to 1. 8.6.2 activation by software the procedure for using the dtc with software activation is as follows: 1. set the mra, mrb, sar, dar, cra, and crb register information in on-chip ram. 2. set the start address of the register information in the dtc vector address. 3. check that the swdte bit is 0. 4. write 1 to swdte bit and the vector number to dtvecr. 5. check the vector number written to dtvecr. 6. after one data transfer has been completed, if the disel bit is 0 and a cpu interrupt is not requested, the swdte bit is cleared to 0. if the dtc is to continue transferring data, set the swdte bit to 1. when the disel bit is 1, or after the specified number of data transfers have been completed, the swdte bit is held at 1 and a cpu interrupt is requested. 8.7 examples of use of the dtc 8.7.1 normal mode an example is shown in which the dtc is used to receive 128 bytes of data via the sci. 1. set mra to a fixed source address (sm1 = sm0 = 0), incrementing destination address (dm1 = 1, dm0 = 0), normal mode (md1 = md0 = 0), and byte size (sz = 0). the dts bit can have any value. set mrb for one data transfer by one interrupt (chne = 0, disel = 0). set the sci rdr address in sar, the start address of the ram area where the data will be received in dar, and 128 (h'0080) in cra. crb can be set to any value. 2. set the start address of the register information at the dtc vector address. 3. set the corresponding bit in dtcer to 1. 4. set the sci to the appropriate receive mode. set the rie bit in scr to 1 to enable the reception complete (rxi) interrupt. since the generation of a receive error during the sci reception operation will disable subsequent reception, the cpu should be enabled to accept receive error interrupts. 5. each time the reception of one byte of data has been completed on the sci, the rdrf flag in ssr is set to 1, an rxi interrupt is generated, and the dtc is activated. the receive data is transferred from rdr to ram by the dtc. dar is incremented and cra is decremented. the rdrf flag is automatically cleared to 0.
rev. 2.0, 09/02, page 125 of 658 6. when cra becomes 0 after the 128 data transfers have been completed, the rdrf flag is held at 1, the dtce bit is cleared to 0, and an rxi interrupt request is sent to the cpu. the interrupt handling routine will perform wrap-up processing. 8.7.2 software activation an example is shown in which the dtc is used to transfer a block of 128 bytes of data by means of software activation. the transfer source address is h'1000 and the destination address is h'2000. the vector number is h'60, so the vector address is h'04c0. 1. set mra to incrementing source address (sm1 = 1, sm0 = 0), incrementing destination address (dm1 = 1, dm0 = 0), block transfer mode (md1 = 1, md0 = 0), and byte size (sz = 0). the dts bit can have any value. set mrb for one block transfer by one interrupt (chne = 0). set the transfer source address (h'1000) in sar, the destination address (h'2000) in dar, and 128 (h'8080) in cra. set 1 (h'0001) in crb. 2. set the start address of the register information at the dtc vector address (h'04c0). 3. check that the swdte bit in dtvecr is 0. check that there is currently no transfer activated by software. 4. write 1 to the swdte bit and the vector number (h'60) to dtvecr. the write data is h'e0. 5. read dtvecr again and check that it is set to the vector number (h'60). if it is not, this indicates that the write failed. this is presumably because an interrupt occurred between steps 3 and 4 and led to a different software activation. to activate this transfer, go back to step 3. 6. if the write was successful, the dtc is activated and a block of 128 bytes of data is transferred. 7. after the transfer, an swdtend interrupt occurs. the interrupt handling routine should clear the swdte bit to 0 and perform other wrap-up processing. 8.8 usage notes 8.8.1 module stop mode setting dtc operation can be disabled or enabled using the module stop control register. the initial setting is for dtc operation to be enabled. register access is disabled by setting module stop mode. module stop mode cannot be set during dtc operation. for details, refer to section 22, power-down modes.
rev. 2.0, 09/02, page 126 of 658 8.8.2 on-chip ram the mra, mrb, sar, dar, cra, and crb registers are all located in on-chip ram. 8.8.3 dtce bit setting for dtce bit setting, use bit manipulation instructions such as bset and bclr. if all interrupts are masked, multiple activation sources can be set at one time (only at the initial setting) by writing data after executing a dummy read on the relevant register.
rev. 2.0, 09/02, page 127 of 658 section 9 i/o ports the h8s/2268 series has ten i/o ports (ports 1, 3, 7, f, h, and j to n), and two input-only port (ports 4 and 9). the h8s/2264 series has eight i/o ports (ports 1, 3, 7, f, h, and j to l), and two input-only port (ports 4 and 9). table 9.1 summarizes the port functions. the pins of each port also have other functions such as input/output or interrupt input pins of on-chip peripheral modules. each i/o port includes a data direction register (ddr) that controls input/output, a data register (dr) that stores output data, and a port register (port) used to read the pin states. the input-only ports do not have ddr and dr registers. port j has a built-in input pull-up mos function and an input pull-up mos control register (pcr) to control the on/off state of input pull-up mos. port 3 includes an open-drain control register (odr) that controls the on/off state of the output buffer pmos. all the i/o ports can drive a single ttl load and a 30 pf capacitive load. the p34 and p35 pins on port 3 are nmos push pull outputs. pins irq and wkp are schmitt-trigger inputs. pins ph0 to ph3 and ports j to n in the h8s/2268 series and pins ph0 to ph3 and ports j to l in the h8s/2264 series are shared as lcd segment pins and common pins. they can be selected on an 8-bit basis in the h8s/2268 series and on a 4- bit basis in the h8s/2264 series.
rev. 2.0, 09/02, page 128 of 658 table 9.1 h8s/2268 series port functions (1) port description port and other functions name input/output and output type port 1 p17/tiocb2/tclkd p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tiocd0/tclkb p12/tiocc0/tclka p11/tiocb0 general i/o port also functioning as tpu i/o pins and interrupt input pins p10/tioca0 port 3 p35/sck1/scl0/ irq5 p34/rxd1/sda0 p33/txd1/sda0 p32/sck0/sda1/ irq4 p31/rxd0 general i/o port also functioning as sci_0 and sci_1 i/o pins, i 2 c bus interface i/o pins, and interrupt input pins p30/txd0 specifiable of open drain output port 4 p47/an7 p46/an6 p45/an5 p44/an4 p43/an3 p42/an2 p41/an1 general input port also functioning as a/d converter analog input pins p40/an0 port 7 p77/txd2 p76/rxd2 p75/tmo3/sck2 p74/tmo2 p73/tmo1 p72/tmo0 p71/tmri23/tmci23 general i/o port also functioning as sci_2 i/o pins and 8-bit timer i/o pins p70/tmri01/tmci01
rev. 2.0, 09/02, page 129 of 658 port description port and other functions name input/output and output type port 9 p97/an9/da1 general input port also functioning as a/d converter analog input and d/a converter analog output pins p96/an8/da0 port f general i/o port also functioning as interrupt input pins and an a/d converter input pins pf3/ adtrg / irq3 port h ph7/toned/tmci4 ph3/com4 ph2/com3 ph1/com2 general input port also functioning as dtmf generation circuit pins, 8-bit reload timer input pins general i/o port also functioning as lcd common output pins ph0/com1 port j pj7/ wkp7 /seg8 built-in input pull-up mos pj6/ wkp6 /seg7 pj5/ wkp5 /seg6 pj4/ wkp4 /seg5 pj3/ wkp3 /seg4 pj2/ wkp2 /seg3 pj1/ wkp1 /seg2 general i/o port also functioning as wakeup input pins and lcd segment output pins pj0/ wkp0 /seg1 port k pk7/seg16 pk6/seg15 pk5/seg14 pk4/seg13 pk3/seg12 pk2/seg11 pk1/seg10 general i/o port also functioning as lcd segment output pins pk0/seg9
rev. 2.0, 09/02, page 130 of 658 port description port and other functions name input/output and output type port l pl7/seg24 pl6/seg23 pl5/seg22 pl4/seg21 pl3/seg20 pl2/seg19 pl1/seg18 general i/o port also functioning as lcd segment output pins pl0/seg17 port m pm7/seg32 pm6/seg31 pm5/seg30 pm4/seg29 pm3/seg28 pm2/seg27 pm1/seg26 general i/o port also functioning as lcd segment output pins pm0/seg25 port n pn7/seg40 pn6/seg39 pn5/seg38 pn4/seg37 pn3/seg36 pn2/seg35 pn1/seg34 general i/o port also functioning as lcd segment output pins pn0/seg33
rev. 2.0, 09/02, page 131 of 658 table 9.1 h8s/2264 series port functions (2) port description port and other functions name input/output and output type port 1 p17/tiocb2 p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tclkb p12/tclka p11 general i/o port also functioning as tpu i/o pins and interrupt input pins p10 port 3 p35/sck1/scl0 p34/rxd1/sda0 p33/txd1 p32/sck0/ irq4 p31/rxd0 general i/o port also functioning as sci_0 and sci_1 i/o pins, i 2 c bus interface i/o pins, and interrupt input pins p30/txd0 specifiable of open drain output port 4 p47/an7 p46/an6 p45/an5 p44/an4 p43/an3 p42/an2 p41/an1 general input port also functioning as a/d converter analog input pins p40/an0 port 7 p77/txd2 p76/rxd2 p75/sck2 p74 p73/tmo1 p72/tmo0 p71 general i/o port also functioning as sci_2 i/o pins and 8-bit timer i/o pins p70/tmri01/tmci01
rev. 2.0, 09/02, page 132 of 658 port description port and other functions name input/output and output type port 9 p97/an9 general input port also functioning as a/d converter analog inputs p96/an8 port f pf3/ adtrg / irq3 general i/o port also functioning as interrupt input pins and an a/d converter input pins port h general input port ph7 ph5 ph4/ ph3/com4 ph2/com3 ph1/com2 general i/o port also functioning as output pin and lcd common output pins ph0/com1 port j pj7/ wkp7 /seg8 built-in input pull-up mos pj6/ wkp6 /seg7 pj5/ wkp5 /seg6 pj4/ wkp4 /seg5 pj3/ wkp3 /seg4 pj2/ wkp2 /seg3 pj1/ wkp1 /seg2 general i/o port also functioning as wakeup input pins and lcd segment output pins pj0/ wkp0 /seg1 port k pk7/seg16 pk6/seg15 pk5/seg14 pk4/seg13 pk3/seg12 pk2/seg11 pk1/seg10 general i/o port also functioning as lcd segment output pins pk0/seg9
rev. 2.0, 09/02, page 133 of 658 port description port and other functions name input/output and output type port l pl7/seg24 pl6/seg23 pl5/seg22 pl4/seg21 pl3/seg20 pl2/seg19 pl1/seg18 general i/o port also functioning as lcd segment output pins pl0/seg17 9.1 port 1 port 1 is an 8-bit i/o port and has the following registers. ? port 1 data direction register (p1ddr) ? port 1 data register (p1dr) ? port 1 register (port1) 9.1.1 port 1 data direction register (p1ddr) p1ddr specifies input or output of the port 1 pins using the individual bits. p1ddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 p17ddr 0 w 6 p16ddr 0 w 5 p15ddr 0 w 4 p14ddr 0 w 3 p13ddr 0 w 2 p12ddr 0 w 1 p11ddr 0 w 0 p10ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 1 pin an output pin. clearing this bit to 0 makes the pin an input pin.
rev. 2.0, 09/02, page 134 of 658 9.1.2 port 1 data register (p1dr) p1dr stores output data for port 1 pins. bit bit name initial value r/w description 7 p17dr 0 r/w 6 p16dr 0 r/w 5 p15dr 0 r/w 4 p14dr 0 r/w 3 p13dr 0 r/w 2 p12dr 0 r/w 1 p11dr 0 r/w 0 p10dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port. 9.1.3 port 1 register (port1) port1 shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7p17 ? * r 6p16 ? * r 5p15 ? * r 4p14 ? * r 3p13 ? * r 2p12 ? * r 1p11 ? * r 0p10 ? * r if a port 1 read is performed while p1ddr bits are set to 1, the p1dr values are read. if a port 1 read is performed while p1ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p17 to p10.
rev. 2.0, 09/02, page 135 of 658 9.1.4 pin functions port 1 pins also function as tpu i/o pins (tclka, tclkb, tclkc, tclkd*, tioca0*, tiocb0*, tiocc0*, tiocd0*, tioca1, tiocb1, tioca2, and tiocb2) and external interrupt input pins ( irq0 and irq1 ). port 1 pin functions are shown below. note: * supported only by the h8s/2268 series. ? p17/tiocb2/tclkd* 3 the pin function is switched as shown below according to the combination of the tpu channel 2 setting, tpsc2 to tps0 bits in tcr0*, and the p17ddr bit. tpu channel 2 setting ** output input or initial value p17ddr ? 01 p17 input p17 output tiocb2 output tiocb2 input * 1 pin function tclkd input * 2 * 3 notes 1. this pin functions as tiocb2 input when tpu channel 2 timer operating mode is set to normal operation or phase counting mode * 3 and iob3 in tior_2 is set to 1. 2. in the h8s/2268 series, this pin functions as tclkd input when tpsc2 to tpsc0 in tcr0 are set to 111 or when channel 2 is set to phase counting mode * 3 . 3. supported only by the h8s/2268 series. ? p16/tioca2/ irq1 the pin function is switched as shown below according to the combination of the tpu channel 2 setting and the p16ddr bit. tpu channel 2 setting ** output input or initial value p16ddr ? 01 p16 input p16 output tioca2 output tioca2 input * 1 pin function irq1 input * 2 notes 1. this pin functions as tioca2 input when tpu channel 2 timer operating mode is set to normal operation or phase counting mode * 3 and ioa3 in tior_2 is 1. 2. when this pin is used as an external interrupt pin, do not specify other functions. 3. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 136 of 658 ? p15/tiocb1/tclkc the pin function is switched as shown below according to the combination of the tpu channel 1 setting, tpsc2 to tpsc0 bits in tcr0* 3 and tcr2, and the p15ddr bit. tpu channel 1 setting ** output input or initial value p15ddr ? 01 p15 input p15 output tiocb1 output tiocb1 input * 1 pin function tclkc input * 2 notes 1. this pin functions as tiocb1 input when tpu channel 1 timer operating mode is set to normal operation or phase counting mode* 3 and iob3 to iob0 in tior_1 are set to10xx. 2. this pin functions as tclkc inputs when tpsc2 to tpsc0 in tcr0* 3 or tcr2 are set to 110 or tclkc input when channel 2 is set to phase counting mode* 3 . 3. supported only by the h8s/2268 series. ? p14/tioca1/ irq0 the pin function is switched as shown below according to the combination of the tpu channel 1 setting and the p14ddr bit. tpu channel 1 setting ** output input or initial value p14ddr ? 01 p14 input p14 output tioca1 output tioca1 input * 1 pin function irq0 input * 2 notes: 1. this pin functions as tioca1 input when tpu channel 1 timer operating mode is set to normal operation or phase counting mode * 3 and ioa3 to ioa0 in tior_1 are set to 10xx. 2. when this pin is used as an external interrupt pin, do not specify other functions. 3. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 137 of 658 ? p13/tiocd0* 3 /tclkb the pin function is switched as shown below according to the combination of the tpu channel 0* 3 setting, tpsc2 to tpsc0 bits in tcr0* 3 , tcr1 and tcr2, and the p13ddr bit. tpu channel 0 setting ** * 3 output input or initial value p13ddr ? 01 p13 input p13 output tiocd0 output * 3 tiocd0 input * 1 * 3 pin function tclkb input * 2 notes: 1. in the h8s/2268 series, this pin functions as tiocd0 input when tpu channel 0 timer operating mode is set to normal operation and iod3 to iod0 in tiorl_0 are set to 10xx. 2. this pin functions as tclkb input when tpsc2 to tpsc0 are set to 101 in any of tcr0 * 3 , tcr1 and tcr2. tclkb input, or when channel 1 is set to phase counting mode * 3 . 3. supported only by the h8s/2268 series. ? p12/tiocc0* 3 /tclka the pin function is switched as shown below according to the combination of the tpu channel 0* 3 setting, tpsc2 to tpsc0 bits in tcr2, tcr1 and tcr0* 3 , and the p12ddr bit. tpu channel 0 setting ** * 3 output input or initial value p12ddr ? 01 p12 input p12 output tiocc0 output * 3 tiocc0 input * 1 * 3 pin function tclka input * 2 notes: 1. in the h8s/2268 series, tiocc0 input when tpu channel 0 timer operating mode is set to normal operation and ioc3 to ioc0 in tiorl_0 are set to 10xx. 2. this functions as tclka input when tpsc2 to tpsc0 are set to 100 in any of tcr2, tcr1 and tcr0 * 3 or when channel 1 is set to phase counting mode * 3 . 3. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 138 of 658 ? p11/tiocb0* 2 the pin function is switched as shown below according to the combination of the tpu channel 0* 2 setting and the p11ddr bit. tpu channel 0 setting ** * 2 output input or initial value p11ddr ? 01 p11 input p11 output pin function tiocb0 output * 2 tiocb0 input * 1 * 2 notes: 1. in the h8s/2268 series, this pin functions as tiocb0 input when tpu channel 0 timer operating mode is set to normal operation and iob3 to iob0 in tiorh_0 are set to 10xx. 2. supported only by the h8s/2268 series. ? p10/tioca0* 2 the pin function is switched as shown below according to the combination of the tpu channel 0* 2 setting and the p10ddr bit. tpu channel 0 setting ** * 2 output input or initial value p10ddr ? 01 p10 input p10 output pin function tioca0 output * 2 tioca0 input * 1 * 2 notes: 1. in the h8s/2268 series, this pin functions as tioca0 input when tpu channel 0 timer operating mode is set to normal operation and ioa3 to ioa0 in tiorh_0 are set to 10xx. 2. supported only by the h8s/2268 series. **: for the setting of the tpu channel, see section 10, 16-bit timer pulse unit (tpu). 9.2 port 3 port 3 is a 6-bit i/o port and has the following registers. ? port 3 data direction register (p3ddr) ? port 3 data register (p3dr) ? port 3 register (port3) ? port 3 open drain control register (p3odr)
rev. 2.0, 09/02, page 139 of 658 9.2.1 port 3 data direction register (p3ddr) p3ddr specifies input or output of the port 3 pins using the individual bits. p3ddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5 p35ddr 0 w 4 p34ddr 0 w 3 p33ddr 0 w 2 p32ddr 0 w 1 p31ddr 0 w 0 p30ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 3 pin an output port. clearing this bit to 0 makes the pin an input port. 9.2.2 port 3 data register (p3dr) p3dr stores output data for port 3 pins. bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5 p35dr 0 r/w 4 p34dr 0 r/w 3 p33dr 0 r/w 2 p32dr 0 r/w 1 p31dr 0 r/w 0 p30dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 140 of 658 9.2.3 port 3 register (port3) port3 shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5p35 ? * r 4p34 ? * r 3p33 ? * r 2p32 ? * r 1p31 ? * r 0p30 ? * r if a port 3 read is performed while p3ddr bits are set to 1, the p3dr values are read. if a port 3 read is performed while p3ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p35 to p30. 9.2.4 port 3 open drain control register (p3odr) p3odr controls on/off state of the pmos for port 3 pins. bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5 p35odr 0 r/w 4 p34odr 0 r/w 3 p33odr 0 r/w 2 p32odr 0 r/w 1 p31odr 0 r/w 0 p30odr 0 r/w when each of p33odr to p30odr bits is set to 1, the corresponding pins p33 to p30 function as nmos open drain outputs. when cleared to 0, the corresponding pins function as cmos outputs. when each of p35odr and p34odr bits is set to 1, the corresponding pins p35 and p34 function as nmos open drain outputs. when they are cleared to 0, the corresponding pins function as nmos push pull outputs.
rev. 2.0, 09/02, page 141 of 658 9.2.5 pin functions the port 3 pins also function as sci i/o input pins (txd0, rxd0, sck0, txd1, rxd1, and sck1), i2c bus interface i/o pins (scl0, sda0, scl1*, and sda1*), and as external interrupt input pins ( irq4 and irq5 *). as shown in figure 9.1, when the pins p34, p35, scl0 or sda0 type open drain output is used, a bus line is not affected even if the power supply for this lsi fails. use (a) type open drain output when using a bus line having a state in which the power is not supplied to this lsi. output 0 (a) open drain output type for p34, p35, sclo and sda0 pins note: * supported only by the h8s/2268 series. nmos off output (b) open drain output type for p33 to p30, scl1 * and sda1 * pins pmos off input 1 input figure 9.1 types of open drain outputs note: * supported only by the h8s/2268 series. the functions of port 3 pins are shown below.
rev. 2.0, 09/02, page 142 of 658 ? p35/sck1/scl0/ irq5 * 2 the pin function is switched as shown below according to the combination of the ice bit in iccr_0 of iic_0, c/ a bit in smr of sci_1, cke0 and cke1 bits in scr and the p35ddr bit. ice 0 1 cke1 0 1 0 c/ a 01 ? 0 cke0 0 1 ?? 0 p35ddr 0 1 ???? p35 input pin p35 output pin sck1 output pin sck1 output pin sck1 input pin scl0 i/o pin pin functions irq5 input * 1 * 2 notes: 1. when this pin is used as an external interrupt pin, do not specify other functions. 2. supported only by the h8s/2268 series. ? p34/rxd1/sda0 the pin function is switched as shown below according to the combination of the ice bit in iccr_0 of iic_0, rxd1s bit in sckcr2*, re bit in scr of sci_1 and the p34ddr bit. ice 01 rxd1s * 01 ? re 01 ?? p34ddr 01 ? 01 ? pin functions p34 input pin p34 output pin rxd1 input pin p34 input pin p34 output pin sdao i/o pin note: * supported only by the h8s/2264 series. ? p33/txd1/scl1* the pin function is switched as shown below according to the combination of the ice bit* in iccr_1 of iic_1, te bit in scr of sci_1 and the p33ddr bit. ice * 01 te 01 ? p33ddr 01 ?? pin functions p33 input pin p33 output pin txd1 output pin scl1 i/o pin * note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 143 of 658 ? p32/sck0/sda1* 2 / irq4 the pin function is switched as shown below according to the combination of the ice bit* 2 in iccr_1 of iic_1, c/ a bit in smr of sci_0, cke0 and cke1 bits in scr and the p32ddr bit. ice * 2 01 cke1 0 1 0 c/ a 01 ? 0 cke0 0 1 ?? 0 p32ddr 0 1 ???? p32 input pin p32 output pin sck0 output pin sck0 output pin sck0 input pin sda1 i/o pin * 2 pin functions irq4 input * 1 notes: 1. when this pin is used as an external interrupt pin, do not specify other functions. 2. supported only by the h8s/2268 series. ? p31/rxd0 the pin function is switched as shown below according to the combination of the re bit in scr of sci_0 and the p31ddr bit. re 01 p31ddr 01 ? pin functions p31 input pin p31 output pin rxd0 input pin ? p30/txd0 the pin function is switched as shown below according to the combination of the te bit in scr of sci_0 and the p30ddr bit. te 01 p30ddr 01 ? pin functions p30 input pin p30 output pin txd0 output pin
rev. 2.0, 09/02, page 144 of 658 9.3 port 4 port 4 is an 8-bit input-only port and has the following register. ? port 4 register (port4) 9.3.1 port 4 register (port4) port4 shows port 4 pin states. this register cannot be modified. bit bit name initial value r/w description 7p47 ? * r 6p46 ? * r 5p45 ? * r 4p44 ? * r 3p43 ? * r 2p42 ? * r 1p41 ? * r 0p40 ? * r the pin states are always read when a port 4 read is performed. note: * determined by the states of pins p47 to p40. 9.3.2 pin functions port 4 pins also function as a/d converter analog input pins (an0 to an7).
rev. 2.0, 09/02, page 145 of 658 9.4 port 7 port 7 is an 8-bit i/o port and has the following registers. ? port 7 data direction register (p7ddr) ? port 7 data register (p7dr) ? port 7 register (port7) 9.4.1 port 7 data direction register (p7ddr) p7ddr specifies input or output of the port 7 pins using the individual bits. p7ddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 p77ddr 0 w 6 p76ddr 0 w 5 p75ddr 0 w 4 p74ddr 0 w 3 p73ddr 0 w 2 p72ddr 0 w 1 p71ddr 0 w 0 p70ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 7 pin an output pin. clearing this bit to 0 makes the pin an input pin. 9.4.2 port 7 data register (p7dr) p7dr stores output data for port 7 pins. bit bit name initial value r/w description 7 p77dr 0 r/w 6 p76dr 0 r/w 5 p75dr 0 r/w 4 p74dr 0 r/w 3 p73dr 0 r/w 2 p72dr 0 r/w 1 p71dr 0 r/w 0 p70dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 146 of 658 9.4.3 port 7 register (port7) port7 shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7p77 ? * r 6p76 ? * r 5p75 ? * r 4p74 ? * r 3p73 ? * r 2p72 ? * r 1p71 ? * r 0p70 ? * r if a port 1 read is performed while p7ddr bits are set to 1, the p7dr values are read. if a port 1 read is performed while p7ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p77 to p70. 9.4.4 pin functions port 7 pins also function as the 8-bit timer i/o pins (tmri01, tmci01, tmri23*, tmci23*, tmo0, tmo1, tmo2*, and tmo3*) and sci i/o pins ( sck2, rxd2 and txd2 ). port 7 pin functions are shown below. note: * supported only by the h8s/2268 series. ? p77/txd2 the pin function is switched as shown below according to the combination of the te bit in scr of sci_2 and the p77ddr bit. te 0 1 p77ddr 0 1 ? pin functions p77 input pin p77 output pin txd2 output pin ? p76/rxd2 the pin function is switched as shown below according to the combination of the re bit in scr of sci_2 and the p76ddr bit. re 0 1 p76ddr 0 1 ? pin functions p76 input pin p76 output pin rxd2 input pin
rev. 2.0, 09/02, page 147 of 658 ? p75/tmo3*/sck2 the pin function is switched as shown below according to the combination of the os3 to os0 bits in tcsr_3* of the 8-bit timer, the c/a bit in smr of sci_2, the cke0 and cke1 bits in scr and the p75ddr bit. os3 to os0 * all bits are 0 any bit is 1 cke1 0 1 ? c/ a 01 ?? cke0 0 1 ??? p75ddr 0 1 ???? pin functions p75 input pin p75 output pin sck2 output pin sck2 output pin sck2 input pin tmo3 output pin * note: * supported only by the h8s/2268 series. ? p74/tmo2* the pin function is switched as shown below according to the combination of the os3 to os0 bits in tcsr_2* of the 8-bit timer and the p74ddr bit. os3 to os0 * all bits are 0 any bit is 1 p74ddr 0 1 ? pin functions p74 input pin p74 output pin tmo2 output pin * note: * supported only by the h8s/2268 series. ? p73/tmo1 the pin function is switched as shown below according to the combination of the os3 to os0 bits in tcsr_1 of the 8-bit timer and the p73ddr bit. os3 to os0 all bits are 0 any bit is 1 p73ddr 0 1 ? pin functions p73 input pin p73 output pin tmo1 output pin ? p72/tmo0 the pin function is switched as shown below according to the combination of the os3 to os0 bits in tcsr_0 of the 8-bit timer and the p72ddr bit. os3 to os0 all bits are 0 any bit is 1 p72ddr 0 1 ? pin functions p72 input pin p72 output pin tmo0 output pin
rev. 2.0, 09/02, page 148 of 658 ? p71/tmri23*/tmci23* the pin function is switched as shown below according to the p71ddr bit. p71ddr 0 1 pin functions p71 input pin p71 output pin tmri23/tmci23 input pin * note: * supported only by the h8s/2268 series. ? p70/tmri01/tmci01 the pin function is switched as shown below according to the p70ddr bit. p70ddr 0 1 pin functions p70 input pin p70 output pin tmri01/tmci01 input pin 9.5 port 9 port 9 is a 2-bit input-only port and has the following register.  port 9 register (port9) 9.5.1 port 9 register (port9) port9 shows port 9 pin states. this register cannot be modified. bit bit name initial value r/w description 7p97 ? * r 6p96 ? * r the pin states are always read when these bits are read. 5 to 0 ? undefined r reserved these bits are always read as undefined value and cannot be modified. note: * determined by the states of pins p97 and p96. 9.5.2 pin functions port 9 pins also function as a/d converter analog input pins (an8 and an9) and d/a converter analog output pins (da0 and da1)*. note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 149 of 658 9.6 port f port f is a 1-bit i/o port and has the following register. ? port f data direction register (pfddr) ? port f data register (pfdr) ? port f register (portf) 9.6.1 port f data direction register (pfddr) pfddr specifies input or output the port f pins using the individual bits. pfddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 3 pf3ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port f pin an output pin. clearing this bit to 0 makes the pin an input pin. 2 to 0 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 9.6.2 port f data register (pfdr) pfdr stores output data for port f pins. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 3 pf3dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port. 2 to 0 ? undefined ? reserved these bits are always read as undefined value and cannot be modified.
rev. 2.0, 09/02, page 150 of 658 9.6.3 port f register (portf) portf shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 3pf3 ? * r if this bit is read while pfddr is set to 1, the pfdr value is read. if this bit is read while pfddr is cleared, the pf3 pin states are read. 2 to 0 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. note: * determined by the states of pf3 pin. 9.6.4 pin functions port f pins also function as an external interrupt input pin ( irq3 ) and a/d trigger output pin ( adtrg ). port f pin functions are shown below. ? pf3/ adtrg / irq3 the pin function is switched as shown below according to the combination of the trgs1 and trgs0 bits of adcr of the a/d converter and the pf3ddr bit. pf3ddr 0 1 pf3 input pin pf3 output pin adtrg input pin * 1 pin functions irq3 input pin * 2 notes: 1. when trgs0 = trgs1 = 1, port f is used as the adtrg input pin. 2. when this port is used as an external interrupt pin, do not specify other functions. 9.7 port h port h for the h8s/2268 series is a 1-bit input and 4-bit i/o port, and that for the h8s/2264 series is a 1-bit input and 6-bit i/o port. port h has the following registers. ? port h data direction register (phddr) ? port h data register (phdr) ? port h register (porth)
rev. 2.0, 09/02, page 151 of 658 9.7.1 port h data direction register (phddr) phddr specifies input or output the port h pins using the individual bits. phddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5 4 ph5ddr ph4ddr 0 * 1 0 * 1 w * 2 w * 2 h8s/2268 series: reserved these bits are always read as undefined value and cannot be modified. h8s/2264 series: when a pin is specified as a general purpose i/o port, setting the bit to 1 makes the corresponding port h pin an output pin. clearing the bit to 0 makes the pin an input pin. 3 ph3ddr 0 w 2 ph2ddr 0 w 1 ph1ddr 0 w 0 ph0ddr 0 w when a pin is specified as a general purpose i/o port, setting these bits to 1 makes the corresponding port h pin an output pin. clearing this bit to 0 makes the pin an input pin. notes: 1. undefined in the h8s/2268 series. 2. this bit cannot be modified in the h8s/2268 series.
rev. 2.0, 09/02, page 152 of 658 9.7.2 port h data register (phdr) phdr stores output data for port h pins (h8s/2268 series: ph3 to ph0; h8s/2264 series: ph5 to ph0). bit bit name initial value r/w description 7, 6 ? undefined ? reserved these bits are always read as undefined value and cannot be modified. 5 4 ph5dr ph4dr 0 * 1 0 * 1 r/w * 2 r/w * 2 h8s/2268 series: reserved these bits are always read as undefined value and cannot be modified. h8s/2264 series: output data for a pin is stored when the pin is specified as a general purpose output port. 3 ph3dr 0 r/w 2 ph2dr 0 r/w 1 ph1dr 0 r/w 0 ph0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port. notes: 1. undefined in the h8s/2268 series. 2. this bit cannot be modified in the h8s/2268 series.
rev. 2.0, 09/02, page 153 of 658 9.7.3 port h register (porth) porth shows the pin states and cannot be modified. bit bit name initial value r/w description 7ph7 ? * 1 r when this bit is read, ph7 pin status is always read. 6 ? undefined ? reserved this bit is always read as undefined value and cannot be modified. 5 4 ph5 ph4 ? * 1 * 2 ? * 1 * 2 r r h8s/2268 series: reserved these bits are always read as undefined value and cannot be modified. h8s/2264 series: if these bits are read while the corresponding phddr bits are set to 1, the phdr value is read. if these bits are read while phddr bits are cleared to 0, the pin states are read. 3ph3 ? * 1 r 2ph2 ? * 1 r 1ph1 ? * 1 r 0ph0 ? * 1 r if these bits are read while the corresponding phddr bits are set to 1, the phdr value is read. if these bits are read while phddr bits are cleared to 0, the pin states are read. notes: 1. in the h8s/2268 series, determined by the states of pins ph7 and ph3 to ph0. in the h8s/2264 series, determined by the states of pins ph7 and ph5 to ph0 2. undefined in the h8s/2268 series only. 9.7.4 pin functions port h pins also function as a dtmf generation circuit analog output pin (toned)* 1 , 8-bit reload timer input pin (tmci4)* 1 , sci input pin (rxd1)* 2 , clock ( ) output pin* 2 and lcd driver common output pins (com4 to com1). port h pin functions are shown below. notes: 1. supported only by the h8s/2268 series. 2. supported only by the h8s/2264 series.
rev. 2.0, 09/02, page 154 of 658 ? ph7/toned* 3 /tmci4* 3 the pin function is switched as shown below according to the combination of the cloe and rwoe bits in dtcr of the dtmf generation circuit* 3 . cloe, rwoe * 3 all bits are 0 any bit is 1 pin functions ph7 input pin * 1 tmci4 input pin * 1 * 2 * 3 toned output pin * 3 notes: 1. voltage applied to ph7 and tmci4 * 3 shoud be within the range of avss (ph7,tmci4) avss. 2. when this port is used as tmci4 input pin * 3 , do not specify other functions. 3. supported only by the h8s/2268 series. ? ph5/rxd1 (h8s/2264 series only) the pin function is switched as shown below according to the combination of the rxd1s bit in sckcr2 and the re bit in sci_1, and the ph5ddr bit. rxd1s, re other than b'11 b'11 ph5ddr 0 1 ? pin functions ph5 input pin ph5 output pin rxd1 input pin ? ph4/ (h8s/2264 series only) the pin function is switched as shown below according to the combination of the phoe bit in sckcr2 and the ph4ddr bit. phoe 0 1 ph4ddr 0 1 ? pin functions ph4 input pin ph4 output pin output pin
rev. 2.0, 09/02, page 155 of 658 ? ph3/com4 the pin function is switched as shown below according to the combination of the dts1, dts0, cmx, and sgs3 to sgs0 bits of lpcr, the sups* bit of lcr2 of the lcd controller/driver and the ph3ddr bit. sgs3 to sgs0 b'0000 h8s/2268 series: b'0001, b'001x, or b'010x h8s/2264 series: b'x01x, b'010x, or b'1100 dts1, dts0 b'xx b'0x b'10 b'11 cmx ? 0101 ? sups * ??? 01 ?? ph3ddr 0101 ? 01 ??? pin functions ph3 input pin ph3 outpu t pin ph3 input pin ph3 outpu t pin com4 output pin ph3 input pin ph3 outpu t pin settin g pro- hibited com4 output pin com4 output pin legend x: don?t care note: * supported only by the h8s/2268 series. ? ph2/com3 the pin function is switched as shown below according to the combination of the dts1, dts0, cmx, sgs3 to sgs0 bits of lpcr of the lcd controller/driver, and ph2ddr bit. sgs3 to sgs0 b'0000 h8s/2268 series: b'0001, b'001x or b'010x h8s/2264 series: b'x01x, b'010x, or b'1100 dts1, dts0 b'xx b'0x b'1x cmx ? 01 ? ph2ddr 0 1 0 1 ? pin functions ph2 input pin ph2 output pin ph2 input pin ph2 output pin com3 output pin legend x: don?t care
rev. 2.0, 09/02, page 156 of 658 ? ph1/com2 the pin function is switched as shown below according to the combination of the dts1, dts0, cmx, sgs3 to sgs0 bits of lpcr of the lcd controller/driver, and ph2ddr bit. sgs3 to sgs0 b'0000 h8s/2268 series: b'0001, b'001x or b'010x h8s/2264 series: b'x01x, b'010x, or b'1100 dts1, dts0 b'xx b'00 other than b'00x cmx ? 01 ? ph1ddr0101 ? pin functions ph1 input pin ph1 output pin ph1 input pin ph1 output pin com2 output pin legend x: don?t care ? ph0/com1 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd controller/driver and the ph0ddr bit. sgs3 to sgs0 b'0000 h8s/2268 series: b'0001, b'001x or b'010x h8s/2264 series: b'x01x, b'010x, or b'1100 ph0ddr 0 1 ? pin functions ph0 input pin ph0 output pin com1 output pin legend x: don?t care 9.8 port j port j is an 8-bit i/o port and has the following registers. ? port j data direction register (pjddr) ? port j data register (pjdr) ? port j register (portj) ? port j pull-up mos control register (pjpcr) ? wakeup control register (wpcr)
rev. 2.0, 09/02, page 157 of 658 9.8.1 port j data direction register (pjddr) pjddr specifies input or output the port j pins using the individual bits. pjddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 pj7ddr 0 w 6 pj6ddr 0 w 5 pj5ddr 0 w 4 pj4ddr 0 w 3 pj3ddr 0 w 2 pj2ddr 0 w 1 pj1ddr 0 w 0 pj0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port j pin an output pin. clearing this bit to 0 makes the pin an input pin. 9.8.2 port j data register (pjdr) pjdr stores output data for port j pins. bit bit name initial value r/w description 7pj7dr 0 r/w 6pj6dr 0 r/w 5pj5dr 0 r/w 4pj4dr 0 r/w 3pj3dr 0 r/w 2pj2dr 0 r/w 1pj1dr 0 r/w 0pj0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 158 of 658 9.8.3 port j register (portj) portj shows port j pin states. this register cannot be modified. bit bit name initial value r/w description 7pj7 ? * r 6pj6 ? * r 5pj5 ? * r 4pj4 ? * r 3pj3 ? * r 2pj2 ? * r 1pj1 ? * r 0pj0 ? * r if a port j read is performed while pjddr bits are set to 1, the pjdr values are read. if a port j read is performed while paddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pj7 to pj0. 9.8.4 port j pull-up mos control register (pjpcr) pjpcr controls the input pull-up mos function for each bit. bit bit name initial value r/w description 7pj7pcr0 r/w 6pj6pcr0 r/w 5pj5pcr0 r/w 4pj4pcr0 r/w 3pj3pcr0 r/w 2pj2pcr0 r/w 1pj1pcr0 r/w 0pj0pcr0 r/w when a pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin.
rev. 2.0, 09/02, page 159 of 658 9.8.5 wakeup control register (wpcr) wpcr controls switching of port j pin functions. for details on interrupt request flags, refer to 5.3.6, wakeup interrupt request register (iwpr). bit bit name initial value r/w description 7wpc7 0 r/w 6wpc6 0 r/w 5wpc5 0 r/w 4wpc4 0 r/w 3wpc3 0 r/w 2wpc2 0 r/w 1wpc1 0 r/w 0wpc0 0 r/w when these bits are set to 1, the corresponding pjn/ wkpn pin becomes the wkpn input pin. when cleared, they become the pjn input/output pin. (n = 7 to 0) 9.8.6 pin functions port j pins also function as wakeup input pins ( wkp7 to wkp0 ) and lcd driver segment output pins (seg8 to seg1). port j pin functions are shown below. ? pjn/ wkpn /segn+1 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd driver/controller, wkp7 to wkp0 bits in wpcr, and pjnddr bit. h8s/2268 series: sgs3 to sgs0 b'00xx or b'0100 b'0101 wpcn 0 1 ? pjnddr 0 1 ?? pin functions pjn input pin pjn output pin wkpn input pin segn+1 output pin legend x: don?t care note: n = 7 to 0
rev. 2.0, 09/02, page 160 of 658 h8s/2264 series: sgs3 to sgs0 b'0000, b?x01x or b'0100 b'0101 wpcn 0 1 ? pjnddr 0 1 ?? pin functions pjn input pin pjn output pin wkpn input pin segn + 1 output pin sgs3 to sgs0 b'0000, b?x01x or b'0100 b'0101 wpcm 0 1 ? pjmddr 0 1 ?? pin functions pjm input pin pjm output pin wkpm input pin segm + 1 output pin legend x: don?t care note: n = 7 to 4, m = 3 to 0 9.8.7 input pull-up mos function port j has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be specified as on or off on an individual bit basis. when port j is set to port input and wakeup input, pjddr is cleared to 0, and then pjpcr is set to 1, the input pull-up mos is turned on. the input pull-up mos function is in the off state after a reset, and in hardware standby mode. the prior state is retained in software standby mode. table 9.2 summarizes the input pull-up mos states in port j. table 9.2 input pull-up mos states (port j) pin states reset hardware standby mode software standby mode in other operations segment output and port output off off off off port input and wakeup input on/off on/off legend : off : input pull-up mos is always off. on/off : on when pjddr = 0 and pjpcr = 1; otherwise off.
rev. 2.0, 09/02, page 161 of 658 9.9 port k port k is an 8-bit i/o port and has the following registers. ? port k data direction register (pkddr) ? port k data register (pkdr) ? port k register (portk) 9.9.1 port k data direction register (pkddr) pkddr specifies input or output the port k pins using the individual bits. pkddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 pk7ddr 0 w 6 pk6ddr 0 w 5 pk5ddr 0 w 4 pk4ddr 0 w 3 pk3ddr 0 w 2 pk2ddr 0 w 1 pk1ddr 0 w 0 pk0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port k pin an output port. clearing this bit to 0 makes the pin an input port. 9.9.2 port k data register (pkdr) pkdr stores output data for port k pins. bit bit name initial value r/w description 7 pk7dr 0 r/w 6 pk6dr 0 r/w 5 pk5dr 0 r/w 4 pk4dr 0 r/w 3 pk3dr 0 r/w 2 pk2dr 0 r/w 1 pk1dr 0 r/w 0 pk0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 162 of 658 9.9.3 port k register (portk) portk shows port k pin states. this register cannot be modified. bit bit name initial value r/w description 7 pk7 ? * r 6 pk6 ? * r 5 pk5 ? * r 4 pk4 ? * r 3 pk3 ? * r 2 pk2 ? * r 1 pk1 ? * r 0 pk0 ? * r if a port k read is performed while pkddr bits are set to 1, the pkdr values are read. if a port k read is performed while pkddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pk7 to pk0. 9.9.4 pin functions port k pins also function as lcd driver segment output pins (seg16 to seg9). port k pin functions are shown below. ? pkn/segn+9 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd driver/controller and pknddr bit. h8s/2268 series: sgs3 to sgs0 b'00xx b'010x pknddr 0 1 ? pin functions pkn input pin pkn output pin segn+9 output pin legend x: don?t care note: n = 7 to 0 h8s/2264 series: sgs3 to sgs0 b'0000, b?x010 or b?0011 b'0101, b?x010 or b?1011 pknddr 0 1 ? pin functions pkn input pin pkn output pin segn+9 output pin
rev. 2.0, 09/02, page 163 of 658 sgs3 to sgs0 b'0000 or b?x01x b?0101 or b?x100 pkmddr 0 1 ? pin functions pkm input pin pkm output pin segm+9 output pin legend x: don?t care note: n = 7 to 4, m = 3 to 0 9.10 port l port l is an 8-bit i/o port and has the following registers. ? port l data direction register (plddr) ? port l data register (pldr) ? port l register (portl) 9.10.1 port l data direction register (plddr) plddr specifies input or output of the port l pins using the individual bits. plddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 pl7ddr 0 w 6 pl6ddr 0 w 5 pl5ddr 0 w 4 pl4ddr 0 w 3 pl3ddr 0 w 2 pl2ddr 0 w 1 pl1ddr 0 w 0 pl0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port l pin an output port. clearing this bit to 0 makes the pin an input port.
rev. 2.0, 09/02, page 164 of 658 9.10.2 port l data register (pldr) pldr stores output data for port l pins. bit bit name initial value r/w description 7 pl7dr 0 r/w 6 pl6dr 0 r/w 5 pl5dr 0 r/w 4 pl4dr 0 r/w 3 pl3dr 0 r/w 2 pl2dr 0 r/w 1 pl1dr 0 r/w 0 pl0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port. 9.10.3 port l register (portl) portl shows port l pin states. this register cannot be modified. bit bit name initial value r/w description 7pl7 ? * r 6pl6 ? * r 5pl5 ? * r 4pl4 ? * r 3pl3 ? * r 2pl2 ? * r 1pl1 ? * r 0pl0 ? * r if a port l read is performed while plddr bits are set to 1, the pldr values are read. if a port l read is performed while plddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pl7 to pl0.
rev. 2.0, 09/02, page 165 of 658 9.10.4 pin functions port l pins also function as lcd driver segment output pins (seg24 to seg17). port l pin functions are shown below. ? pln/segn+17 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd driver/controller and plnddr bit. h8s/2268 series: sgs3 to sgs0 b'000x or b'0010 b'0011, or b'010x plnddr 0 1 ? pin functions pln input pin pln output pin segn+17 output pin legend x: don?t care note: n = 7 to 0 h8s/2264 series: sgs3 to sgs0 b'00x0 b'0101, b?x100, b?x011 or b'1010 plnddr 0 1 ? pin functions pln input pin pln output pin segn+17 output pin sgs3 to sgs0 b?0000 or b'x010 b'0101, b?x100 or b?x011 plmddr 0 1 ? pin functions plm input pin plm output pin segm+17 output pin legend x: don?t care note: n = 7 to 4, m = 3 to 0
rev. 2.0, 09/02, page 166 of 658 9.11 port m (h8s/2268 series only) port m is an 8-bit i/o port and has the following registers. ? port m data direction register (pmddr) ? port m data register (pmdr) ? port m register (portm) 9.11.1 port m data direction register (pmddr) pmddr specifies input or output of the port m pins using the individual bits. pmddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 pm7ddr 0 w 6 pm6ddr 0 w 5 pm5ddr 0 w 4 pm4ddr 0 w 3 pm3ddr 0 w 2 pm2ddr 0 w 1 pm1ddr 0 w 0 pm0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port m pin an output port. clearing this bit to 0 makes the pin an input port. 9.11.2 port m data register (pmdr) pmdr stores output data for port m pins. bit bit name initial value r/w description 7pm7dr 0 r/w 6pm6dr 0 r/w 5pm5dr 0 r/w 4pm4dr 0 r/w 3pm3dr 0 r/w 2pm2dr 0 r/w 1pm1dr 0 r/w 0pm0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 167 of 658 9.11.3 port m register (portm) portm shows port m pin states. bit bit name initial value r/w description 7pm7 ? * r 6pm6 ? * r 5pm5 ? * r 4pm4 ? * r 3pm3 ? * r 2pm2 ? * r 1pm1 ? * r 0pm0 ? * r if a port m read is performed while pmddr bits are set to 1, the pmdr values are read. if a port m read is performed while pmddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pm7 to pm0. 9.11.4 pin functions port m pins also function as lcd driver segment output pins (seg32 to seg25). port m pin functions are shown below. ? pmn/segn+25 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd driver/controller and pmnddr bit. sgs3 to sgs0 b'000x b'001x, or b'010x pmnddr 0 1 ? pin functions pmn input pin pmn output pin segn+25 output pin legend x: don?t care note: n = 7 to 0
rev. 2.0, 09/02, page 168 of 658 9.12 port n (h8s/2268 series only) port n is an 8-bit i/o port and has the following registers. ? port n data direction register (pnddr) ? port n data register (pndr) ? port n register (portn) 9.12.1 port n data direction register (pnddr) pnddr specifies input or output of the port n pins using the individual bits. pnddr cannot be read; if it is, an undefined value will be read. bit bit name initial value r/w description 7 pn7ddr 0 w 6 pn6ddr 0 w 5 pn5ddr 0 w 4 pn4ddr 0 w 3 pn3ddr 0 w 2 pn2ddr 0 w 1 pn1ddr 0 w 0 pn0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port n pin an output port. clearing this bit to 0 makes the pin an input port. 9.12.2 port n data register (pndr) pndr stores output data for port n pins. bit bit name initial value r/w description 7 pn7dr 0 r/w 6 pn6dr 0 r/w 5 pn5dr 0 r/w 4 pn4dr 0 r/w 3 pn3dr 0 r/w 2 pn2dr 0 r/w 1 pn1dr 0 r/w 0 pn0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose output port.
rev. 2.0, 09/02, page 169 of 658 9.12.3 port n register (portn) portn shows port n pin states. bit bit name initial value r/w description 7pn7 ? * r 6pn6 ? * r 5pn5 ? * r 4pn4 ? * r 3pn3 ? * r 2pn2 ? * r 1pn1 ? * r 0pn0 ? * r if a port n read is performed while pnddr bits are set to 1, the pndr values are read. if a port n read is performed while pnddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pn7 to pn0. 9.12.4 pin functions port n pins also function as lcd driver segment output pins (seg40 to seg33). port n pin functions are shown below. ? pnn/segn+33 the pin function is switched as shown below according to the combination of the sgs3 to sgs0 bits in lpcr of the lcd driver/contoller and pnnddr bit. sgs3 to sgs0 b'0000 b'0001, b'001x, or b'010x pnnddr 0 1 ? pin functions pnn input pin pnn output pin segn+33 output pin legend x: don?t care note: n = 7 to 0
rev. 2.0, 09/02, page 170 of 658
rev. 2.0, 09/02, page 171 of 658 section 10 16-bit timer pulse unit (tpu) the h8s/2268 series has an on-chip 16-bit timer pulse unit (tpu) comprised of three 16-bit timer channels, and the h8s/2264 series has the tpu comprised of two 16-bit timer channels. the function list of the tpu is shown in table 10.1. a block diagram of the tpu for the h8s/2268 series and that for the h8s/2264 series are shown figures 10.1 and 10.2, respectively. 10.1 features ? maximum 8-pulse input/output (h8s/2268 series) ? maximum 4-pulse input/output (h8s/2264 series) ? selection of 7 or 8 counter input clocks for each channel ? the following operations can be set for each channel: ? waveform output at compare match ? input capture function ? counter clear operation ? synchronous operation: multiple timer counters (tcnt) can be written to simultaneously simultaneous clearing by compare match and input capture is possible register simultaneous input/output is possible by synchronous counter operation ? pwm output with any duty level is possible ? a maximum 7-phase (h8s/2268 series)/3-phase (h8s/2264 series) pwm output is possible in combination with synchronous operation ? buffer operation settable for channel 0 (h8s/2268 series only) ? phase counting mode settable independently for each of channels 1 and 2 (h8s/2268 series only) ? operation with cascaded connection (h8s/2264 series only) ? fast access via internal 16-bit bus ? 13-type interrupt sources (h8s/2268 series) ? 6-type interrupt sources (h8s/2264 series) ? register data can be transmitted automatically ? a/d converter conversion start trigger can be generated ? module stop mode can be set timtpu3b_000020020700
rev. 2.0, 09/02, page 172 of 658 table 10.1 tpu functions item channel 0 * 1 channel 1 channel 2 count clock /1 /4 /16 /64 tclka tclkb tclkc tclkd /1 /4 /16 /64 /256 tclka tclkb /1 /4 /16 /64 /1024 tclka tclkb tclkc general registers (tgr) tgra_0 tgrb_0 tgra_1 tgrb_1 tgra_2 tgrb_2 general registers/ buffer registers * 1 tgrc_0 tgrd_0 ?? i/o pins tioca0 tiocb0 tiocc0 tiocd0 tioca1 tiocb1 tioca2 tiocb2 counter clear function tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture 0 output 1 output compare match output toggle output input capture function synchronous operation pwm mode phase counting mode * 1 ? buffer operation * 1 ??
rev. 2.0, 09/02, page 173 of 658 item channel 0 * 1 channel 1 channel 2 dtc activation * 1 tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture a/d converter trigger tgra_0 compare match or input capture tgra_1 compare match or input capture tgra_2 compare match or input capture interrupt sources 5 sources  compare match or input capture 0a  compare match or input capture 0b  compare match or input capture 0c  compare match or input capture 0d  overflow 4 sources * 1 3 sources * 2  compare match or input capture 1a  compare match or input capture 1b  overflow  underflow * 1 4 sources * 1 3 sources * 2  compare match or input capture 2a  compare match or input capture 2b  overflow  underflow * 1 legend : possible ? : not possible notes: 1. supported only by the h8s/2268 series. 2. supported only by the h8s/2264 series.
rev. 2.0, 09/02, page 174 of 658 channel 2 tmdr tsr tcr tior tier tgra tcnt tgrb tgrc channel 1 tmdr tsr tcr tior tier tgra tcnt tgrb channel 0 control logic for channel 0 to 2 tgra tcnt tgrb tgrd bus interface common tsyr control logic tstr /1 /4 /16 /64 /256 /1024 tclka tclkb tclkc tclkd legend tstr: tsyr: tcr: tmdr: timer start register timer synchro register timer control register timer mode register timer i/o control registers (h, l) timer interrupt enable register timer status register timer general registers (a, b, c, d) tioca0 tiocb0 tiocc0 tiocd0 tioca1 tiocb1 tioca2 tiocb2 interrupt request signals channel 0: channel 1: channel 2: internal data bus a/d convertion start request signal module data bus tgi0a tgi0b tgi0c tgi0d tci0v tgi1a tgi1b tci1v tci1u tgi2a tgi2b tci2v tci2u tmdr tsr tcr tiorh tier tiorl input/output pins channel 0: channel 1: channel 2: clock input internal clock: external clock: tior(h, l) tier: tsr: tgr(a, b, c, d): figure 10.1 block diagram of tpu for h8s/2268 series
rev. 2.0, 09/02, page 175 of 658 channel 2 tmdr tsr tcr tior tier channel 1 tmdr tsr tcr tior tier tgra tcnt tgrb control logic for channel 1 to 2 tgra tcnt tgrb bus interface common tsyr control logic tstr /1 /4 /16 /64 /256 /1024 tclka tclkb tclkc legend tstr: tsyr: tcr: tmdr: timer start register timer synchro register timer control register timer mode register timer i/o control registers timer interrupt enable register timer status register timer general registers (a, b) tioca1 tiocb1 tioca2 tiocb2 interrupt request signals channel 1: channel 2: internal data bus a/d convertion start request signal module data bus tgi1a tgi1b tci1v tci1u tgi2a tgi2b tci2v tci2u input/output pins channel 1: channel 2: clock input internal clock: external clock: tior tier: tsr: tgr(a, b): figure 10.2 block diagram of tpu for h8s/2264 series
rev. 2.0, 09/02, page 176 of 658 10.2 input/output pins table 10.2 tpu pins channel symbol i/o function all tclka input external clock a input pin (channel 1 phase counting mode a phase input * ) tclkb input external clock b input pin (channel 1 phase counting mode b phase input * ) tclkc input external clock c input pin (channel 2 phase counting mode a phase input * ) tclkd * input external clock d input pin (channel 2 phase counting mode b phase input * ) 0 * tioca0 i/o tgra_0 input capture input/output compare output/pwm output pin tiocb0 i/o tgrb_0 input capture input/output compare output/pwm output pin tiocc0 i/o tgrc_0 input capture input/output compare output/pwm output pin tiocd0 i/o tgrd_0 input capture input/output compare output/pwm output pin 1 tioca1 i/o tgra_1 input capture input/output compare output/pwm output pin tiocb1 i/o tgrb_1 input capture input/output compare output/pwm output pin 2 tioca2 i/o tgra_2 input capture input/output compare output/pwm output pin tiocb2 i/o tgrb_2 input capture input/output compare output/pwm output pin note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 177 of 658 10.3 register descriptions the tpu has the following registers. to distinguish registers in each channel, an underscore and the channel number are added as a suffix to the register name; tcr for channel 0 is expressed as tcr_0. ? timer control register_0 (tcr_0)* ? timer mode register_0 (tmdr_0)* ? timer i/o control register h_0 (tiorh_0)* ? timer i/o control register l_0 (tiorl_0)* ? timer interrupt enable register_0 (tier_0)* ? timer status register_0 (tsr_0)* ? timer counter_0 (tcnt_0)* ? timer general register a_0 (tgra_0)* ? timer general register b_0 (tgrb_0)* ? timer general register c_0 (tgrc_0)* ? timer general register d_0 (tgrd_0)* ? timer control register_1 (tcr_1) ? timer mode register_1 (tmdr_1) ? timer i/o control register _1 (tior_1) ? timer interrupt enable register_1 (tier_1) ? timer status register_1 (tsr_1) ? timer counter_1 (tcnt_1) ? timer general register a_1 (tgra_1) ? timer general register b_1 (tgrb_1) ? timer control register_2 (tcr_2) ? timer mode register_2 (tmdr_2) ? timer i/o control register_2 (tior_2) ? timer interrupt enable register_2 (tier_2) ? timer status register_2 (tsr_2) ? timer counter_2 (tcnt_2) ? timer general register a_2 (tgra_2) ? timer general register b_2 (tgrb_2) common registers ? timer start register (tstr) ? timer synchro register (tsyr)
rev. 2.0, 09/02, page 178 of 658 note: * supported only by the h8s/2268 series. 10.3.1 timer control register (tcr) the tcr registers control the tcnt operation for each channel. the h8s/2268 series tpu has a total of three tcr registers and the h8s/2264 series tpu has a total of two tcr registers, one for each channel (channels 0 to 2, or 1 and 2). tcr register settings should be conducted only when tcnt operation is stopped. bit bit name initial value r/w description 7 6 5 cclr2 cclr1 cclr0 0 0 0 r/w r/w r/w counter clear 0 to 2 these bits select the tcnt counter clearing source. see tables 10.3 and 10.4 for details. 4 3 ckeg1 ckeg0 0 0 r/w r/w clock edge 0 and 1 these bits select the input clock edge. when the input clock is counted using both edges, the input clock period is halved (e.g. /4 both edges = /2 rising edge). internal clock edge selection is valid when the input clock is /4 or slower. if the input clock is 1, this setting is ignored and count at rising edge is selected. in the h8s/2268 series, if phase counting mode is used on channels 1 and 2, this setting is ignored and the phase counting mode setting has priority. 00: count at rising edge 01: count at falling edge 1x: count at both edges legend x: don?t care 2 1 0 tpsc2 tpsc1 tpsc0 0 0 0 r/w r/w r/w time prescaler 0 to 2 these bits select the tcnt counter clock. the clock source can be selected independently for each channel. see tables10.5 to10.7 for details.
rev. 2.0, 09/02, page 179 of 658 table 10.3 cclr0 to cclr2 (channel 0) (h8s/2268 series only) channel bit 7 cclr2 bit 6 cclr1 bit 5 cclr0 description 0 0 0 0 tcnt clearing disabled 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 1 0 0 tcnt clearing disabled 1 tcnt cleared by tgrc compare match/input capture * 2 1 0 tcnt cleared by tgrd compare match/input capture * 2 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation is set by setting the sync bit in tsyr to 1. 2. when tgrc or tgrd is used as a buffer register, tcnt is not cleared because the buffer register setting has priority, and compare match/input capture does not occur. table 10.4 cclr0 to cclr2 (channels 1 and 2) channel bit 7 reserved * 2 bit 6 cclr1 bit 5 cclr0 description 1, 2 0 0 0 tcnt clearing disabled 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation is selected by setting the sync bit in tsyr to 1. 2. bit 7 is reserved in channels 1 and 2. it is always read as 0 and cannot be modified.
rev. 2.0, 09/02, page 180 of 658 table 10.5 tpsc0 to tpsc2 (channel 0) (h8s/2268 series only) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 0 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 external clock: counts on tclkd pin input table 10.6 tpsc0 to tpsc2 (channel 1) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 1 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 internal clock: counts on /256 1 counts on tcnt_2 overflow. (h8s/2268 series: setting disabled) note: * this setting is ignored when channel 1 is in phase counting mode (h8s/2268 series only).
rev. 2.0, 09/02, page 181 of 658 table 10.7 tpsc0 to tpsc2 (channels 2) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 2 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 internal clock: counts on /1024 note: * this setting is ignored when channel 2 is in phase counting mode (h8s/2268 series only).
rev. 2.0, 09/02, page 182 of 658 10.3.2 timer mode register (tmdr) the tmdr registers are used to set the operating mode of each channel. the h8s/2268 series tpu has three tmdr registers and the h8s/2264 series tpu has two tmdr registers, one for each channel (channels 0 to 2, or 1 and 2). tmdr register settings should be changed only when tcnt operation is stopped. bit bit name initial value r/w description 7, 6 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. 5 bfb 0 r/w h8s/2268 series: buffer operation b specifies whether tgrb is to operate in the normal way, or tgrb and tgrd are to be used together for buffer operation. when tgrd is used as a buffer register, tgrd input capture/output compare is not generated. in channels 1 and 2, which have no tgrd, bit 5 is reserved. it is always read as 0 and cannot be modified. 0: tgrb operates normally 1: tgrb and tgrd used together for buffer operation h8s/2264 series: reserved these bits are always read as 0 and cannot be modified.
rev. 2.0, 09/02, page 183 of 658 bit bit name initial value r/w description 4 bfa 0 r/w h8s/2268 series: buffer operation a specifies whether tgra is to operate in the normal way, or tgra and tgrc are to be used together for buffer operation. when tgrc is used as a buffer register, tgrc input capture/output compare is not generated. in channels 1 and 2, which have no tgrc, bit 4 is reserved. it is always read as 0 and cannot be modified. 0: tgra operates normally 1:tgra and tgrc used together for buffer operation h8s/2264 series: reserved these bits are always read as 0 and cannot be modified. 3 2 1 0 md3 md2 md1 md0 0 0 0 0 r/w r/w r/w r/w modes 0 to 3 these bits are used to set the timer operating mode. md3 is a reserved bit. in a write, it should always be written with 0. see table 10.8 for details. table 10.8 md0 to md3 bit 3 md3 * 1 bit 2 md2 * 2 bit 1 md1 bit 0 md0 description 0 0 0 0 normal operation 1 reserved 1 0 pwm mode 1 1 pwm mode 2 1 0 0 phase counting mode 1 1 phase counting mode 2 1 0 phase counting mode 3 1 phase counting mode 4 1xxx ? legend x: don?t care notes: 1. md3 is a reserved bit. in a write, it should always be written with 0. 2. phase counting mode cannot be set in the h8s/2264 series or for channels 0 in the h8s/2268 series. in this case, 0 should always be written to md2.
rev. 2.0, 09/02, page 184 of 658 10.3.3 timer i/o control register (tior) the tior registers control the tgr registers. the h8s/2268 series tpu has four tior registers and the h8s/2264 series tpu has two tior registers, two for channel 0, and one each for channels 1 and 2. care is required as tior is affected by the tmdr setting. the initial output specified by tior is valid when the counter is stopped (the cst bit in tstr is cleared to 0). note also that, in pwm mode 2, the output at the point at which the counter is cleared to 0 is specified. in the h8s/2268 series, when tgrc or tgrd is designated for buffer operation, this setting is invalid and the register operates as a buffer register. ? tiorh_0 (h8s/2268 series only), tior_1, tior_2 bit bit name initial value r/w description 7 6 5 4 iob3 iob2 iob1 iob0 all 0 r/w i/o control b0 to b3 specify the function of tgrb. for details, refer to table 10.9, 10.11, and 10.12. 3 2 1 0 ioa3 ioa2 ioa1 ioa0 all 0 r/w i/o control a0 to a3 specify the function of tgra. for details, refer to table 10.13, 10.15, and 10.16. ? tiorl_0 (h8s/2268 series only) bit bit name initial value r/w description 7 6 5 4 iod3 iod2 iod1 iod0 all 0 r/w i/o control d0 to d3 specify the function of tgrd. for details, refer to table 10.10. 3 2 1 0 ioc3 ioc2 ioc1 ioc0 all 0 r/w i/o control c0 to c3 specify the function of tgrc. for details, refer to table 10.14.
rev. 2.0, 09/02, page 185 of 658 table 10.9 tiorh_0 (channel 0) (h8s/2268 series only) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_0 function tiocb0 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tiocb0 pin input capture at rising edge 1 capture input source is tiocb0 pin input capture at falling edge 1 x capture input source is tiocb0 pin input capture at both edges 1xx input capture register setting disabled legend x: don?t care
rev. 2.0, 09/02, page 186 of 658 table 10.10 tiorl_0 (channel 0) (h8s/2268 series only) description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_0 function tiocd0 pin function 0 0 0 0 output disabled 1 output compare register * initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tiocd0 pin input capture at rising edge 1 capture input source is tiocd0 pin input capture at falling edge 1x input capture register * capture input source is tiocd0 pin input capture at both edges 1 x x setting disabled legend x: don?t care note: * when the bfb bit in tmdr_0 is set to 1 and tgrd_0 is used as a buffer register, this setting is invalid and input capture/output compare is not generated.
rev. 2.0, 09/02, page 187 of 658 table 10.11 tior_1 (channel 1) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_1 function tiocb1 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tiocb1 pin input capture at rising edge 1 capture input source is tiocb1 pin input capture at falling edge 1x input capture register capture input source is tiocb1 pin input capture at both edges 1 x x setting disabled legend x: don?t care
rev. 2.0, 09/02, page 188 of 658 table 10.12 tior_2 (channel 2) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_2 function tiocb2 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 capture input source is tiocb2 pin input capture at rising edge 1 capture input source is tiocb2 pin input capture at falling edge 1x input capture register capture input source is tiocb2 pin input capture at both edges legend x: don?t care
rev. 2.0, 09/02, page 189 of 658 table 10.13 tiorh_0 (channel 0) (h8s/2268 series only) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_0 function tioca0 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tioca0 pin input capture at rising edge 1 capture input source is tioca0 pin input capture at falling edge 1x input capture register capture input source is tioca0 pin input capture at both edges 1 x x setting disabled legend x: don?t care
rev. 2.0, 09/02, page 190 of 658 table 10.14 tiorl_0 (channel 0) (h8s/2268 series only) description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_0 function tiocc0 pin function 0 0 0 0 output disabled 1 output compare register * initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tiocc0 pin input capture at rising edge 1 capture input source is tiocc0 pin input capture at falling edge 1 x capture input source is tiocc0 pin input capture at both edges 1xx input capture register * setting disabled legend x: don?t care note: * when the bfa bit in tmdr_0 is set to 1 and tgrc_0 is used as a buffer register, this setting is invalid and input capture/output compare is not generated.
rev. 2.0, 09/02, page 191 of 658 table 10.15 tior_1 (channel 1) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_1 function tioca1 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 capture input source is tioca1 pin input capture at rising edge 1 capture input source is tioca1 pin input capture at falling edge 1x input capture register capture input source is tioca1 pin input capture at both edges 1 x x setting disabled legend x: don?t care
rev. 2.0, 09/02, page 192 of 658 table 10.16 tior_2 (channel 2) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_2 function tioca2 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output disabled 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 capture input source is tioca2 pin input capture at rising edge 1 capture input source is tioca2 pin input capture at falling edge 1x input capture register capture input source is tioca2 pin input capture at both edges legend x: don?t care 10.3.4 timer interrupt enable register (tier) the tier registers control enabling or disabling of interrupt requests for each channel. the h8s/2268 series tpu has three tier registers and the h8s/2264 series tpu has two tier registers, one for each channel (channels 0 to 2, or 1 and 2).
rev. 2.0, 09/02, page 193 of 658 bit bit name initial value r/w description 7 ttge 0 r/w a/d conversion start request enable enables or disables generation of a/d conversion start requests by tgra input capture/compare match. 0: a/d conversion start request generation disabled 1: a/d conversion start request generation enabled 6 ? 1 ? reserved this bit is always read as 1 and cannot be modified. 5 tcieu 0 r/w h8s/2268 series: underflow interrupt enable enables or disables interrupt requests (tciu) by the tcfu flag when the tcfu flag in tsr is set to 1 in channels 1 and 2. in channel 0, bit 5 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tciu) by tcfu disabled 1: interrupt requests (tciu) by tcfu enabled h8s/2264 series: the write value should always be 0. 4 tciev 0 r/w overflow interrupt enable enables or disables interrupt requests (tciv) by the tcfv flag when the tcfv flag in tsr is set to 1. 0: interrupt requests (tciv) by tcfv disabled 1: interrupt requests (tciv) by tcfv enabled 3 tgied 0 r/w tgr interrupt enable d enables or disables interrupt requests (tgid) by the tgfd bit when the tgfd bit in tsr is set to 1 in channel 0. in channels 1 and 2, bit 3 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tgid) by tgfd bit disabled 1: interrupt requests (tgid) by tgfd bit enabled 2 tgiec 0 r/w tgr interrupt enable c enables or disables interrupt requests (tgic) by the tgfc bit when the tgfc bit in tsr is set to 1 in channel 0. in channels 1 and 2, bit 2 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tgic) by tgfc bit disabled 1: interrupt requests (tgic) by tgfc bit enabled
rev. 2.0, 09/02, page 194 of 658 bit bit name initial value r/w description 1 tgieb 0 r/w tgr interrupt enable b enables or disables interrupt requests (tgib) by the tgfb bit when the tgfb bit in tsr is set to 1. 0: interrupt requests (tgib) by tgfb bit disabled 1: interrupt requests (tgib) by tgfb bit enabled 0 tgiea 0 r/w tgr interrupt enable a enables or disables interrupt requests (tgia) by the tgfa bit when the tgfa bit in tsr is set to 1. 0: interrupt requests (tgia) by tgfa bit disabled 1: interrupt requests (tgia) by tgfa bit enabled 10.3.5 timer status register (tsr) the tsr registers indicate the status of each channel. the h8s/2268 series tpu has three tsr registers and the h8s/2264 series tpu has two tsr registers, one for each channel (channels 0 to 2, or 1 and 2). bit bit name initial value r/w description 7 tcfd 1 r h8s/2268 series: count direction flag status flag that shows the direction in which tcnt counts in channels 1 and 2. in channel 0, bit 7 is reserved. it is always read as 1 and cannot be modified. 0: tcnt counts down 1: tcnt counts up h8s/2264 series: reserved this bit is always read as 1 and cannot be modified. 6 ? 1 ? reserved this bit is always read as 1 and cannot be modified.
rev. 2.0, 09/02, page 195 of 658 bit bit name initial value r/w description 5 tcfu 0 r/(w) * 1 h8s/2268 series: underflow flag status flag that indicates that tcnt underflow has occurred when channels 1 and 2 are set to phase counting mode. only 0 can be written, for flag clearing. in channel 0, bit 5 is reserved. it is always read as 0 and cannot be modified. [setting condition] when the tcnt value underflows (changes from h?0000 to h?ffff) [clearing condition] when 0 is written to tcfu after reading tcfu = 1 h8s/2264 series: reserved this bit is always read as 0 and cannot be modified. 4 tcfv 0 r/(w) * 1 overflow flag status flag that indicates that tcnt overflow has occurred. only 0 can be written, for flag clearing. [setting condition] when the tcnt value overflows (changes from h?ffff to h?0000 ) [clearing condition] when 0 is written to tcfv after reading tcfv = 1
rev. 2.0, 09/02, page 196 of 658 bit bit name initial value r/w description 3tgfd 0 r/(w) * 1 h8s/2268 series: input capture/output compare flag d status flag that indicates the occurrence of tgrd input capture or compare match in channel 0. only 0 can be written, for flag clearing. in channels 1 and 2, bit 3 is reserved. it is always read as 0 and cannot be modified. [setting conditions]  when tcnt = tgrd and tgrd is functioning as output compare register  when tcnt value is transferred to tgrd by input capture signal and tgrd is functioning as input capture register [clearing conditions]  when dtc is activated by tgid interrupt and the disel bit of mrb in dtc is 0  when 0 is written to tgfd after reading tgfd = 1 h8s/2264 series: reserved this bit is always read as 0 and cannot be modified.
rev. 2.0, 09/02, page 197 of 658 bit bit name initial value r/w description 2tgfc 0 r/(w) * 1 h8s/2268 series: input capture/output compare flag c status flag that indicates the occurrence of tgrc input capture or compare match in channel 0. only 0 can be written, for flag clearing. in channels 1 and 2, bit 2 is reserved. it is always read as 0 and cannot be modified. [setting conditions]  when tcnt = tgrc and tgrc is functioning as output compare register  when tcnt value is transferred to tgrc by input capture signal and tgrc is functioning as input capture register [clearing conditions]  when dtc is activated by tgic interrupt and the disel bit of mrb in dtc is 0  when 0 is written to tgfc after reading tgfc = 1 h8s/2264 series: reserved this bit is always read as 0 and cannot be modified.
rev. 2.0, 09/02, page 198 of 658 bit bit name initial value r/w description 1tgfb 0 r/(w) * 1 input capture/output compare flag b status flag that indicates the occurrence of tgrb input capture or compare match. only 0 can be written, for flag clearing. [setting conditions]  when tcnt = tgrb and tgrb is functioning as output compare register  when tcnt value is transferred to tgrb by input capture signal and tgrb is functioning as input capture register [clearing conditions]  when dtc*2 is activated by tgib interrupt and the disel bit of mrb in dtc*2 is 0  when 0 is written to tgfb after reading tgfb = 1 0tgfa 0 r/(w) * 1 input capture/output compare flag a status flag that indicates the occurrence of tgra input capture or compare match. only 0 can be written, for flag clearing. [setting conditions]  when tcnt = tgra and tgra is functioning as output compare register  when tcnt value is transferred to tgra by input capture signal and tgra is functioning as input capture register [clearing conditions]  when dtc * 2 is activated by tgia interrupt and the disel bit of mrb in dtc * 2 is 0  when 0 is written to tgfa after reading tgfa = 1 notes: 1. only 0 can be written to this bit to clear the flag. 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 199 of 658 10.3.6 timer counter (tcnt) the tcnt registers are 16-bit readable/writable counters. the h8s/2268 series tpu has three tcnt counters and the h8s/2264 series tpu has two tcnt counters, one for each channel (channels 0 to 2, or 1 and 2). the tcnt counters are initialized to h'0000 by a reset, or in hardware standby mode. the tcnt counters cannot be accessed in 8-bit units; they must always be accessed as a 16-bit unit. 10.3.7 timer general register (tgr) the tgr registers are dual function 16-bit readable/writable registers, functioning as either output compare or input capture registers. the h8s/2268 series tpu has eight tgr registers and the h8s/2264 series tpu has four tgr registers, four for channel 0 and two each for channels 1 and 2. tgr is initialized to h'ffff at reset or in hardware standby mode. the tgr registers cannot be accessed in 8-bit units; they must always be accessed as a 16-bit unit. in the h8s/2268 series, tgrc and tgrd for channel 0 can also be designated for operation as buffer registers. tgr buffer register combinations are tgra?tgrc and tgrb?tgrd. 10.3.8 timer start register (tstr) tstr selects operation/stoppage for channels 0 to 2 in the h8s/2268 series and for channels 1 and 2 in the h8s/2264 series. when setting the operating mode in tmdr or setting the count clock in tcr, first stop the tcnt counter.
rev. 2.0, 09/02, page 200 of 658 bit bit name initial value r/w description 7 to 3 ? all 0 ? reserved the write value should always be 0. 2 1 0 cst2 cst1 cst0 * 0 0 0 r/w r/w r/w counter start 0 to 2 (cst0 to cst2) these bits select operation or stoppage for tcnt. if 0 is written to the cst bit during operation with the tioc pin designated for output, the counter stops but the tioc pin output compare output level is retained. if tior is written to when the cst bit is cleared to 0, the pin output level will be changed to the set initial output value. 0: tcnt_n count operation is stopped 1: tcnt_n performs count operation (n = 0 to 2) note: * in the h8s/2264 series, this bit is reserved. the write value should always be 0.
rev. 2.0, 09/02, page 201 of 658 10.3.9 timer synchro register (tsyr) tsyr selects independent operation or synchronous operation of the tcnt counters for channels 0 to 2 in the h8s/2268 series and for channels 1 and 2 in the h8s/2264 series. a channel performs synchronous operation when the corresponding bit in tsyr is set to 1. bit bit name initial value r/w description 7 to 3 ? 0 ? reserved the write value should always be 0. 2 1 0 sync2 sync1 sync0 * 0 0 0 r/w r/w r/w timer synchro 0 to 2 these bits are used to select whether operation is independent of or synchronized with other channels. when synchronous operation is selected, the tcnt synchronous presetting of multiple channels, and synchronous clearing by counter clearing on another channel, are possible. to set synchronous operation, the sync bits for at least two channels must be set to 1. to set synchronous clearing, in addition to the sync bit , the tcnt clearing source must also be set by means of bits cclr0 to cclr2 in tcr. 0: tcnt_n operates independently (tcnt presetting /clearing is unrelated to other channels) 1: tcnt_n performs synchronous operation tcnt synchronous presetting/synchronous clearing is possible (n = 0 to 2) note: * in the h8s/2264 series, this bit is reserved. the write value should always be 0.
rev. 2.0, 09/02, page 202 of 658 10.4 interface to bus master 10.4.1 16-bit registers tcnt and tgr are 16-bit registers. as the data bus to the master is 16 bits wide, these registers can be read or written to in 8-bit units; 16-bit access must always be used. an example of 16-bit register access operation is shown in figure 10.3. h l bus master tcnth tcntl module data bus bus interface internal data bus figure 10.3 16-bit register access operation [ bus master ? tcnt (16 bits) ] 10.4.2 8-bit registers registers other than tcnt and tgr are 8-bit. as the data bus to the cpu is 16 bits wide, these registers can be read and written to in 16-bit units. they can also be read and written to in 8-bit units. examples of 8-bit register access operation are shown in figure 10.4, 10.5, and 10.6. bus interface h internal data bus l bus master module data bus tcr figure 10.4 8-bit register access operation [ bus master ? tcr (upper 8 bits) ]
rev. 2.0, 09/02, page 203 of 658 bus interface h internal data bus l bus master module data bus tmdr figure 10.5 8-bit register access operation [ bus master ? tmdr (lower 8 bits) ] bus interface h internal data bus l bus master module data bus tcr tmdr figure 10.6 8-bit register access operation [ bus master ? tcr and tmdr (16 bits) ] 10.5 operation 10.5.1 basic functions each channel has a tcnt and tgr register. tcnt performs up-counting, and is also capable of free-running operation, synchronous counting, and external event counting. each tgr can be used as an input capture register or output compare register. counter operation: when one of bits cst0 to cst2 in the h8s/2268 series or one of bits cst1 and cst2 in the h8s/2264 series is set to 1 in tstr, the tcnt counter for the corresponding channel begins counting. tcnt can operate as a free-running counter, periodic counter, for example. 1. example of count operation setting procedure figure 10.7 shows an example of the count operation setting procedure.
rev. 2.0, 09/02, page 204 of 658 operation selection select counter clock periodic counter select counter clearing source select output compare register set period free-running counter start count operation note: * in the h8s/2264 series, bits cclr1 and cclr0 in tcr. start count operation select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. for periodic counter operation, select the tgr to be used as the tcnt clearing source with bits cclr2 to cclr0 * in tcr. designate the tgr selected in [2] as an output compare register by means of tior. set the periodic counter cycle in the tgr selected in [2]. set the cst bit in tstr to 1 to start the counter operation. [1] [1] [2] [2] [3] [3] [4] [4] [5] [5] figure 10.7 example of counter operation setting procedure 2. free-running count operation and periodic count operation immediately after a reset, the tpu?s tcnt counters are all designated as free-running counters. when the relevant bit in tstr is set to 1 the corresponding tcnt counter starts up- count operation as a free-running counter. when tcnt overflows (from h'ffff to h'0000), the tcfv bit in tsr is set to 1. if the value of the corresponding tciev bit in tier is 1 at this point, the tpu requests an interrupt. after overflow, tcnt starts counting up again from h'0000. figure 10.8 illustrates free-running counter operation.
rev. 2.0, 09/02, page 205 of 658 tcnt value h'ffff h'0000 cst bit tcfv time figure 10.8 free-running counter operation when compare match is selected as the tcnt clearing source, the tcnt counter for the relevant channel performs periodic count operation. the tgr register for setting the period is designated as an output compare register, and counter clearing by compare match is selected by means of bits cclr0 to cclr2 in the h8s/2268 series tcr or bits cclr0 and cclr1 in the h8s/2264 series tcr. after the settings have been made, tcnt starts up-count operation as a periodic counter when the corresponding bit in tstr is set to 1. when the count value matches the value in tgr, the tgf bit in tsr is set to 1 and tcnt is cleared to h'0000. if the value of the corresponding tgie bit in tier is 1 at this point, the tpu requests an interrupt. after a compare match, tcnt starts counting up again from h'0000. figure 10.9 illustrates periodic counter operation. tcnt value tgr h'0000 cst bit tgf note: * supported only by the h8s/2268 series. time counter cleared by tgr compare match flag cleared by software or dtc * activation figure 10.9 periodic counter operation
rev. 2.0, 09/02, page 206 of 658 waveform output by compare match: the tpu can perform 0, 1, or toggle output from the corresponding output pin using compare match. 1. example of setting procedure for waveform output by compare match figure 10.10 shows an example of the setting procedure for waveform output by compare match. input selection select waveform output mode start count operation < waveform output > select initial value 0 output or 1 output, and compare match output value 0 output, 1 output, or toggle output, by means of tior. the set initial value is output at the tioc pin unit the first compare match occurs. set the timing for compare match generation in tgr. set the cst bit in tstr to 1 to start the count operation. [1] [2] [1] [2] set output timing [3] [3] figure 10.10 example of setting procedure for waveform output by compare match 2. examples of waveform output operation figure 10.11 shows an example of 0 output/1 output. in this example tcnt has been designated as a free-running counter, and settings have been made such that 1 is output by compare match a, and 0 is output by compare match b. when the set level and the pin level coincide, the pin level does not change. tcnt value h'ffff h'0000 tioca tiocb time tgra tgrb no change no change no change no change 1 output 0 output figure 10.11 example of 0 output/1 output operation figure 10.12 shows an example of toggle output.
rev. 2.0, 09/02, page 207 of 658 in this example, tcnt has been designated as a periodic counter (with counter clearing on compare match b), and settings have been made such that the output is toggled by both compare match a and compare match b. tcnt value h'ffff h'0000 tiocb tioca time tgrb tgra toggle output toggle output counter cleared by tgrb compare match figure 10.12 example of toggle output operation input capture function: the tcnt value can be transferred to tgr on detection of the tioc pin input edge. rising edge, falling edge, or both edges can be selected as the detected edge. 1. example of input capture operation setting procedure figure 10.13 shows an example of the input capture operation setting procedure. input selection select input capture input start count designate tgr as an input capture register by means of tior, and select rising edge, falling edge, or both edges as the input capture source and input signal edge. set the cst bit in tstr to 1 to start the count operation. [1] [2] [1] [2] figure 10.13 example of input capture operation setting procedure
rev. 2.0, 09/02, page 208 of 658 2. example of input capture operation figure 10.14 shows an example of input capture operation. in this example both rising and falling edges have been selected as the tioca pin input capture input edge, the falling edge has been selected as the tiocb pin input capture input edge, and counter clearing by tgrb input capture has been designated for tcnt. tcnt value h'0180 h'0000 tioca tgra h'0010 h'0005 counter cleared by tiocb input (falling edge) h'0160 h'0005 h'0160 h'0010 tgrb h'0180 tiocb time figure 10.14 example of input capture operation 10.5.2 synchronous operation in synchronous operation, the values in a number of tcnt counters can be rewritten simultaneously (synchronous presetting). also, a number of tcnt counters can be cleared simultaneously by making the appropriate setting in tcr (synchronous clearing). synchronous operation enables tgr to be incremented with respect to a single time base. channels 0 to 2 in the h8s/2268 series or channels 1 and 2 in the h8s/2264 series can all be designated for synchronous operation. example of synchronous operation setting procedure: figure 10.15 shows an example of the synchronous operation setting procedure.
rev. 2.0, 09/02, page 209 of 658 no yes synchronous operation selection set synchronous operation synchronous presetting set tcnt synchronous clearing clearing source generation channel? select counter clearing source start count set synchronous counter clearing start count set to 1 the sync bits in tsyr corresponding to the channels to be designated for synchronous operation. when the tcnt counter of any of the channels designated for synchronous operation is written to, the same value is simultaneously written to the other tcnt counters. use bits cclr2 to cclr0 * in tcr to specify tcnt clearing by input capture/output compare, etc. use bits cclr2 to cclr0 * in tcr to designate synchronous clearing for the counter clearing source. set to 1 the cst bits in tstr for the relevant channels, to start the count operation. [1] [2] [3] [4] [5] note: * in the h8s/2264 series, bits ccrl1 and cclr0 in tcr. [1] [3] [5] [4] [5] [2] figure 10.15 example of synchronous operation setting procedure example of synchronous operation: figure 10.16 shows an example of synchronous operation. in this example, synchronous operation and pwm mode 1 have been designated for channels 0 to 2 in the h8s/2268 series, tgrb_0 compare match has been set as the channel 0 counter clearing source, and synchronous clearing has been set for the channel 1 and 2 counter clearing source. three-phase pwm waveforms are output from pins tioc0a, tioc1a, and tioc2a. at this time, synchronous presetting, and synchronous clearing by tgrb_0 compare match, are performed for channel 0 to 2 tcnt counters, and the data set in tgrb_0 is used as the pwm cycle. for details of pwm modes, see section 10.5.5, pwm modes.
rev. 2.0, 09/02, page 210 of 658 tcnt0 to tcnt2 values h'0000 tioca0 tioca1 tgrb_0 synchronous clearing by tgrb_0 compare match tgra_2 tgra_1 tgrb_2 tgra_0 tgrb_1 tioca2 time figure 10.16 example of synchronous operation 10.5.3 buffer operation (h8s/2268 series only) buffer operation, provided for channel 0, enables tgrc and tgrd to be used as buffer registers. buffer operation differs depending on whether tgr has been designated as an input capture register or as a compare match register. table 10.17 shows the register combinations used in buffer operation. table 10.17 register combinations in buffer operation channel timer general register buffer register 0 tgra_0 tgrc_0 tgrb_0 tgrd_0 ? when tgr is an output compare register when a compare match occurs, the value in the buffer register for the corresponding channel is transferred to the timer general register. this operation is illustrated in figure 10.17.
rev. 2.0, 09/02, page 211 of 658 buffer register timer general register tcnt comparator compare match signal figure 10.17 compare match buffer operation ? when tgr is an input capture register when input capture occurs, the value in tcnt is transferred to tgr and the value previously held in the timer general register is transferred to the buffer register. this operation is illustrated in figure 10.18. buffer register timer general register tcnt input capture signal figure 10.18 input capture buffer operation example of buffer operation setting procedure: figure 10.19 shows an example of the buffer operation setting procedure. buffer operation select tgr function set buffer operation start count [1] [2] [3] [1] [2] [3] designate tgr as an input capture register or output compare register by means of tior. designate tgr for buffer operation with bits bfa and bfb in tmdr. set the cst bit in tstr to 1 start the count operation. figure 10.19 example of buffer operation setting procedure
rev. 2.0, 09/02, page 212 of 658 examples of buffer operation: 1. when tgr is an output compare register figure 10.20 shows an operation example in which pwm mode 1 has been designated for channel 0, and buffer operation has been designated for tgra and tgrc. the settings used in this example are tcnt clearing by compare match b, 1 output at compare match a, and 0 output at compare match b. as buffer operation has been set, when compare match a occurs the output changes and the value in buffer register tgrc is simultaneously transferred to timer general register tgra. this operation is repeated each time that compare match a occurs. for details of pwm modes, see section 10.5.5, pwm modes. tcnt value tgrb_0 h'0000 tgrc_0 tgra_0 h'0200 h'0520 tioca h'0200 h'0450 h'0520 h'0450 tgra_0 h'0450 h'0200 transfer time figure 10.20 example of buffer operation (1) 2. when tgr is an input capture register figure 10.21 shows an operation example in which tgra has been designated as an input capture register, and buffer operation has been designated for tgra and tgrc. counter clearing by tgra input capture has been set for tcnt, and both rising and falling edges have been selected as the tioca pin input capture input edge. as buffer operation has been set, when the tcnt value is stored in tgra upon the occurrence of input capture a, the value previously stored in tgra is simultaneously transferred to tgrc.
rev. 2.0, 09/02, page 213 of 658 tcnt value h'09fb h'0000 tgrc time h'0532 tioca tgra h'0f07 h'0532 h'0f07 h'0532 h'0f07 h'09fb figure 10.21 example of buffer operation (2) 10.5.4 operation with cascaded connection (h8s/2264 series only) operation as a 32-bit timer can be performed by cascading two 16-bit counter channels. this function is enabled when the tpsc2 to tpsc0 bits in tcr are set to count on tcnt2 overflow for the channel 1 counter clock. table 10.18 shows the counter combination used in operation with the cascaded connection. table 10.18 counter combination in operation with cascaded connection combination upper 16 bits lower 16 bits channel 1 and channel 2 tcnt1 tcnt2 setting procedure for operation with cascaded connection: figure 10.22 shows the cascaded connection operation setting procedure.
rev. 2.0, 09/02, page 214 of 658 operation with cascaded connection [1] [1] set bits tpsc2 to tpsc0 in tcr in channel 1 to b'111 to select to count on tcnt2 overflow. [2] set the cst bit in tstr corresponding the upper and lower channels to start counting. [2] set operation with cascaded connection start operation with cascaded connection figure 10.22 setting procedure for operation with cascaded operation example of operation with cascaded connection: figure 10.23 shows an example of operation with cascaded connection, where tcnt1 is set to count tcnt2 overflow, tcra_1 and tcra_2 are set to be input capture registers, and the tioc pin rising edge is selected. if rising edges are input simultaneously to the tioca1 and tioca2 pins, the upper 16 bits of 32- bit data are transferred to tgra_1 and the lower 16 bits are transferred to tgra_2. tioca1 tioca2 tcnt2 tcnt1 tcnt1 clock tcnt2 clock h'03a2 h'03a1 h'ffff h'0000 h'0001 tgra_1 h'03a2 h'0000 tgra_2 figure 10.23 example of operation with cascaded connection
rev. 2.0, 09/02, page 215 of 658 10.5.5 pwm modes in pwm mode, pwm waveforms are output from the output pins. the output level can be selected as 0, 1, or toggle output in response to a compare match of each tgr. designating tgr compare match as the counter clearing source enables the period to be set in that register. all channels can be designated for pwm mode independently. synchronous operation is also possible. there are two pwm modes, as described below. ? pwm mode 1 h8s/2268 series: pwm output is generated from the tioca and tiocc pins by pairing tgra with tgrb and tgrc with tgrd. the output specified by bits ioa0 to ioa3 and ioc0 to ioc3 in tior is output from the tioca and tiocc pins at compare matches a and c, and the output specified by bits iob0 to iob3 and iod0 to iod3 in tior is output at compare matches b and d. the initial output value is the value set in tgra or tgrc. if the set values of paired tgrs are identical, the output value does not change when a compare match occurs. in pwm mode 1, pwm output is enable up to 4 phases. h8s/2264 series: pwm output is generated from the tioca pin by pairing tgra with tgrb. the output specified by bits ioa0 to ioa3 in tior is output from the tioca pin at compare match a, and the output specified by bits iob0 to iob3 in tior is output at compare match b. the initial output value is the value set in tgra. if the set values of paired tgrs are identical, the output value does not change when a compare match occurs. in pwm mode 1, pwm output is enable up to 2 phases. ? pwm mode 2 pwm output is generated using one tgr as the cycle register and the others as duty registers. the output specified in tior is performed by means of compare matches. upon counter clearing by a synchronization register compare match, the output value of each pin is the initial value set in tior. if the set values of the cycle and duty registers are identical, the output value does not change when a compare match occurs. in pwm mode 2, pwm output is enabled up to 7 phases in the h8s/2268 series or 3 phases in the h8s/2264 series by using also synchronous operation. the correspondence between pwm output pins and registers is shown in table 10.19.
rev. 2.0, 09/02, page 216 of 658 table 10.19 pwm output registers and output pins output pins channel registers pwm mode 1 pwm mode 2 * 2 0 * 1 tgra_0 tioca0 tioca0 tgrb_0 tiocb0 tgrc_0 tiocc0 tiocc0 tgrd_0 tiocd0 1 tgra_1 tioca1 tioca1 tgrb_1 tiocb1 2 tgra_2 tioca2 tioca2 tgrb_2 tiocb2 notes: 1. supported only by the h8s/2268 series. 2. in pwm mode 2, pwm output is not possible for the tgr register in which the period is set. example of pwm mode setting procedure: figure 10.24 shows an example of the pwm mode setting procedure. pwm mode select counter clock select counter clearing source select waveform output level set tgr set pwm mode start count select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. use bits cclr2 to cclr0 * in tcr to select the tgr to be used as the tcnt clearing source. use tior to designate the tgr as an output compare register, and select the initial value and output value. set the cycle in the tgr selected in [2], and set the duty in the other the tgr. select the pwm mode with bits md3 to md0 in tmdr. set the cst bit in tstr to 1 start the count operation. [1] [2] [3] [4] [5] [6] [1] note: * in the h8s/2264 series, bits cclr1 and cclr0 in tcr. [2] [3] [4] [5] [6] figure 10.24 example of pwm mode setting procedure
rev. 2.0, 09/02, page 217 of 658 examples of pwm mode operation: figure 10.25 shows an example of pwm mode 1 operation. in this example, tgra compare match is set as the tcnt clearing source, 0 is set for the tgra initial output value and output value, and 1 is set as the tgrb output value. in this case, the value set in tgra is used as the period, and the values set in the tgrb registers are used as the duty levels. tcnt value tgra h'0000 tioca time tgrb counter cleared by tgra compare match figure 10.25 example of pwm mode operation (1) figure 10.26 shows an example of pwm mode 2 operation. in this example, synchronous operation is designated for channels 0 and 1, tgrb_1 compare match is set as the tcnt clearing source, and 0 is set for the initial output value and 1 for the output value of the other tgr registers (tgra_0 to tgrd_0, tgra_1), outputting a 5-phase pwm waveform, in the h8s/2268 series. in this case, the value set in tgrb_1 is used as the cycle, and the values set in the other tgrs are used as the duty levels.
rev. 2.0, 09/02, page 218 of 658 tcnt value tgrb_1 h'0000 tioca0 counter cleared by tgrb_1 compare match time tgra_1 tgrd_0 tgrc_0 tgrb_0 tgra_0 tiocb0 tiocc0 tiocd0 tioca1 figure 10.26 example of pwm mode operation (2) figure 10.27 shows examples of pwm waveform output with 0% duty and 100% duty in pwm mode.
rev. 2.0, 09/02, page 219 of 658 tcnt value tgra h'0000 tioca time tgrb 0% duty tgrb rewritten tgrb rewritten tgrb rewritten tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously 0% duty figure 10.27 example of pwm mode operation (3)
rev. 2.0, 09/02, page 220 of 658 10.5.6 phase counting mode (h8s/2268 series only) in phase counting mode, the phase difference between two external clock inputs is detected and tcnt is incremented/decremented accordingly. this mode can be set for channels 1 and 2. when phase counting mode is set, an external clock is selected as the counter input clock and tcnt operates as an up/down-counter regardless of the setting of bits tpsc0 to tpsc2 and bits ckeg0 and ckeg1 in tcr. however, the functions of bits cclr0 and cclr1 in tcr, and of tior, tier, and tgr, are valid, and input capture/compare match and interrupt functions can be used. if overflow occurs when tcnt is counting up, the tcfv flag in tsr is set; if underflow occurs when tcnt is counting down, the tcfu flag is set. the tcfd bit in tsr is the count direction flag. reading the tcfd flag reveals whether tcnt is counting up or down. table 10.20 shows the correspondence between external clock pins and channels. table 10.20 phase counting mode clock input pins external clock pins channels a-phase b-phase when channel 1 is set to phase counting mode tclka tclkb when channel 2 is set to phase counting mode tclkc tclkd example of phase counting mode setting procedure: figure 10.28 shows an example of the phase counting mode setting procedure. phase counting mode select phase counting mode start count select phase counting mode with bits md3 to md0 in tmdr. set the cst bit in tstr to 1 to start the count operation. [1] [2] [1] [2] figure 10.28 example of phase counting mode setting procedure
rev. 2.0, 09/02, page 221 of 658 examples of phase counting mode operation: in phase counting mode, tcnt counts up or down according to the phase difference between two external clocks. there are four modes, according to the count conditions. 1. phase counting mode 1 figure 10.29 shows an example of phase counting mode 1 operation, and table 10.21 summarizes the tcnt up/down-count conditions. tcnt value time down-count up-count tclka(channel 1) tclkc(channel 2) tclkb(channel 1) tclkd(channel 2) figure 10.29 example of phase counting mode 1 operation table 10.21 up/down-count conditions in phase counting mode 1 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level up-count low level low level high level high level down-count low level high level low level legend : rising edge : falling edge
rev. 2.0, 09/02, page 222 of 658 2. phase counting mode 2 figure 10.30 shows an example of phase counting mode 2 operation, and table 10.22 summarizes the tcnt up/down-count conditions. time down-count up-count tcnt value tclka(channel 1) tclkc(channel 2) tclkb(channel 1) tclkd(channel 2) figure 10.30 example of phase counting mode 2 operation table 10.22 up/down-count conditions in phase counting mode 2 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level don?t care low level don?t care low level don?t care high level up-count high level don?t care low level don?t care high level don?t care low level down-count legend : rising edge : falling edge
rev. 2.0, 09/02, page 223 of 658 3. phase counting mode 3 figure 10.31 shows an example of phase counting mode 3 operation, and table 10.23 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka(channel 1) tclkc(channel 2) tclkb(channel 1) tclkd(channel 2) figure 10.31 example of phase counting mode 3 operation table 10.23 up/down-count conditions in phase counting mode 3 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level don?t care low level don?t care low level don?t care high level up-count high level down-count low level don?t care high level don?t care low level don?t care legend : rising edge : falling edge
rev. 2.0, 09/02, page 224 of 658 4. phase counting mode 4 figure 10.32 shows an example of phase counting mode 4 operation, and table 10.24 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka(channels 1) tclkc(channels 2) tclkb(channels 1) tclkd(channels 2) figure 10.32 example of phase counting mode 4 operation table 10.24 up/down-count conditions in phase counting mode 4 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level up-count low level low level don?t care high level high level down-count low level high level don?t care low level legend : rising edge : falling edge
rev. 2.0, 09/02, page 225 of 658 10.6 interrupt sources there are three kinds of tpu interrupt source for the h8s/2268 series; tgr input capture/compare match, tcnt overflow, and tcnt underflow. there are two kinds of tpu interrupt source for the h8s/2264 series; tgr input capture/compare match and tcnt overflow. each interrupt source has its own status flag and enable/disabled bit, allowing the generation of interrupt request signals to be enabled or disabled individually. when an interrupt request is generated, the corresponding status flag in tsr is set to 1. if the corresponding enable/disable bit in tier is set to 1 at this time, an interrupt is requested. the interrupt request is cleared by clearing the status flag to 0. in the h8s/2268 series, relative channel priorities can be changed by the interrupt controller, however the priority order within a channel is fixed. for details, see section 5, interrupt controller. table 10.25 lists the tpu interrupt sources. table 10.25 tpu interrupts channel name interrupt source interrupt flag dtc activation * priority level 0 * tgi0a tgra_0 input capture/compare match tgfa_0 possible high tgi0b tgrb_0 input capture/compare match tgfb_0 possible tgi0c tgrc_0 input capture/compare match tgfc_0 possible tgi0d tgrd_0 input capture/compare match tgfd_0 possible tci0v tcnt_0 overflow tcfv_0 not possible 1 tgi1a tgra_1 input capture/compare match tgfa_1 possible tgi1b tgrb_1 input capture/compare match tgfb_1 possible tci1v tcnt_1 overflow tcfv_1 not possible tci1u * tcnt_1 underflow tcfu_1 not possible 2 tgi2a tgra_2 input capture/compare match tgfa_2 possible tgi2b tgrb_2 input capture/compare match tgfb_2 possible tci2v tcnt_2 overflow tcfv_2 not possible tci2u * tcnt_2 underflow tcfu_2 not possible low note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 226 of 658 input capture/compare match interrupt: an interrupt is requested if the tgie bit in tier is set to 1 when the tgf flag in tsr is set to 1 by the occurrence of a tgr input capture/compare match on a particular channel. the interrupt request is cleared by clearing the tgf flag to 0. the h8s/2268 series tpu has eight input capture/compare match interrupts and the h8s/2264 series tpu has four input capture/compare match interrupts, four for channel 0, and two each for channels 1 and 2. overflow interrupt: an interrupt is requested if the tciev bit in tier is set to 1 when the tcfv flag in tsr is set to 1 by the occurrence of tcnt overflow on a channel. the interrupt request is cleared by clearing the tcfv flag to 0. the h8s/2268 series tpu has three overflow interrupts and the h8s/2264 series tpu has two overflow interrupts, one for each channel (channels 0 to 2, or 1 and 2). underflow interrupt (h8s/2268 series only): an interrupt is requested if the tcieu bit in tier is set to 1 when the tcfu flag in tsr is set to 1 by the occurrence of tcnt underflow on a channel. the interrupt request is cleared by clearing the tcfu flag to 0. the tpu has two underflow interrupts, one each for channels 1 and 2. 10.7 dtc activation (h8s/2268 series only) the dtc can be activated by the tgr input capture/compare match interrupt for a channel. for details, see section 8, data transfer controller (dtc). a total of eight tpu input capture/compare match interrupts can be used as dtc activation sources, four for channel 0, and two each for channels 1 and 2. 10.8 a/d converter activation the a/d converter can be activated by the tgra input capture/compare match for a channel. if the ttge bit in tier is set to 1 when the tgfa flag in tsr is set to 1 by the occurrence of a tgra input capture/compare match on a particular channel, a request to begin a/d conversion is sent to the a/d converter. if the tpu conversion start trigger has been selected on the a/d converter side at this time, a/d conversion is begun. in the h8s/2268 series tpu, a total of three tgra input capture/compare match interrupts can be used as a/d converter conversion start sources, one for each channel (channels 0 to 2). while in the h8s/2264 series tpu, a total of two tgra input capture/compare match interrupts can be used, one for each channel (channels 1 and 2).
rev. 2.0, 09/02, page 227 of 658 10.9 operation timing 10.9.1 input/output timing tcnt count timing: figure 10.33 shows tcnt count timing in internal clock operation, and figure 10.34 shows tcnt count timing in external clock operation. tcnt tcnt input clock internal clock n-1 n n+1 n+2 falling edge rising edge figure 10.33 count timing in internal clock operation tcnt tcnt input clock external clock n-1 n n+1 n+2 falling edge rising edge falling edge figure 10.34 count timing in external clock operation output compare output timing: a compare match signal is generated in the final state in which tcnt and tgr match (the point at which the count value matched by tcnt is updated). when a compare match signal is generated, the output value set in tior is output at the output compare output pin. after a match between tcnt and tgr, the compare match signal is not generated until the tcnt input clock is generated.
rev. 2.0, 09/02, page 228 of 658 figure 10.35 shows output compare output timing. tgr tcnt tcnt input clock n n n+1 compare match signal tioc pin figure 10.35 output compare output timing input capture signal timing: figure 10.36 shows input capture signal timing. tcnt input capture input n n+1 n+2 n n+2 tgr input capture signal figure 10.36 input capture input signal timing
rev. 2.0, 09/02, page 229 of 658 timing for counter clearing by compare match/input capture: figure 10.37 shows the timing when counter clearing on compare match is specified, and figure 10.38 shows the timing when counter clearing on input capture is specified. tcnt counter clear signal compare match signal tgr n n h'0000 figure 10.37 counter clear timing (compare match) tcnt counter clear signal input capture signal tgr n h'0000 n figure 10.38 counter clear timing (input capture)
rev. 2.0, 09/02, page 230 of 658 buffer operation timing (h8s/2268 series only): figures 10.39 and 10.40 show the timing in buffer operation. tgra, tgrb compare match signal tcnt tgrc, tgrd nn n n n+1 figure 10.39 buffer operation timing (compare match) tgra, tgrb tcnt input capture signal tgrc, tgrd n n n n+1 n n n+1 figure 10.40 buffer operation timing (input capture)
rev. 2.0, 09/02, page 231 of 658 10.9.2 interrupt signal timing tgf flag setting timing in case of compare match: figure 10.41 shows the timing for setting of the tgf flag in tsr on compare match, and tgi interrupt request signal timing. tgr tcnt tcnt input clock n n n+1 compare match signal tgf flag tgi interrupt figure 10.41 tgi interrupt timing (compare match) tgf flag setting timing in case of input capture: figure 10.42 shows the timing for setting of the tgf flag in tsr on input capture, and tgi interrupt request signal timing. tgr tcnt input capture signal n n tgf flag tgi interrupt figure 10.42 tgi interrupt timing (input capture)
rev. 2.0, 09/02, page 232 of 658 tcfv flag/tcfu flag setting timing: figure 10.43 shows the timing for setting of the tcfv flag in tsr on overflow, and tciv interrupt request signal timing. figure 10.44 shows the timing for setting of the tcfu flag in tsr on underflow, and tciu interrupt request signal timing in the h8s/2268 series. overflow signal tcnt (overflow) tcnt input clock h'ffff h'0000 tcfv flag tciv interrupt figure 10.43 tciv interrupt setting timing underflow signal tcnt (underflow) tcnt input clock h'0000 h'ffff tcfu flag tciu interrupt figure 10.44 tciu interrupt setting timing (h8s/2268 series only)
rev. 2.0, 09/02, page 233 of 658 status flag clearing timing: after a status flag is read as 1 by the cpu, it is cleared by writing 0 to it. when the dtc is activated in the h8s/2268 series, the flag is cleared automatically. figure 10.45 shows the timing for status flag clearing by the cpu, and figure 10.46 shows the timing for status flag clearing by the dtc. status flag write signal address tsr address interrupt request signal tsr write cycle t1 t2 figure 10.45 timing for status flag clearing by cpu interrupt request signal status flag address source address dtc read cycle t1 t2 destination address t1 t2 dtc write cycle figure 10.46 timing for status flag clearing by dtc activation (h8s/2268 series only)
rev. 2.0, 09/02, page 234 of 658 10.10 usage notes 10.10.1 module stop mode setting tpu operation can be disabled or enabled using the module stop control register. the initial setting is for tpu operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 22, power-down modes. 10.10.2 input clock restrictions the input clock pulse width must be at least 1.5 states in the case of single-edge detection, and at least 2.5 states in the case of both-edge detection. the tpu will not operate properly at narrower pulse widths. in the h8s/2268 series phase counting mode, the phase difference and overlap between the two input clocks must be at least 1.5 states, and the pulse width must be at least 2.5 states. figure 10.47 shows the input clock conditions in phase counting mode. overlap phase differ- ence phase differ- ence overlap tclka (tclkc) tclkb (tclkd) pulse width pulse width pulse width pulse width notes: phase difference and overlap pulse width : 1.5 states or more : 2.5 states or more figure 10.47 phase difference, overlap, and pulse width in phase counting mode (h8s/2268 series only)
rev. 2.0, 09/02, page 235 of 658 10.10.3 caution on period setting when counter clearing on compare match is set, tcnt is cleared in the final state in which it matches the tgr value (the point at which the count value matched by tcnt is updated). consequently, the actual counter frequency is given by the following formula: f = (n + 1) where f : counter frequency : operating frequency n : tgr set value 10.10.4 contention between tcnt write and clear operations if the counter clear signal is generated in the t2 state of a tcnt write cycle, tcnt clearing takes precedence and the tcnt write is not performed. figure 10.48 shows the timing in this case. counter clear signal write signal address tcnt address tcnt tcnt write cycle t1 t2 n h'0000 figure 10.48 contention between tcnt write and clear operations
rev. 2.0, 09/02, page 236 of 658 10.10.5 contention between tcnt write and increment operations if incrementing occurs in the t2 state of a tcnt write cycle, the tcnt write takes precedence and tcnt is not incremented. figure 10.49 shows the timing in this case. tcnt input clock write signal address tcnt address tcnt tcnt write cycle t1 t2 n m tcnt write data figure 10.49 contention between tcnt write and increment operations 10.10.6 contention between tgr write and compare match if a compare match occurs in the t2 state of a tgr write cycle, the tgr write takes precedence and the compare match signal is inhibited. a compare match does not occur even if the previous value is written.
rev. 2.0, 09/02, page 237 of 658 figure 10.50 shows the timing in this case. compare match signal write signal address tgr address tcnt tgr write cycle t1 t2 n m tgr write data tgr n n+1 inhibited figure 10.50 contention between tgr write and compare match 10.10.7 contention between buffer register write and compare match (h8s/2268 series only) if a compare match occurs in the t2 state of a tgr write cycle, the data that is transferred to tgr by the buffer operation will be that in the buffer prior to the write. figure 10.51 shows the timing in this case. compare match signal write signal address buffer register address buffer register tgr write cycle t1 t2 n tgr n m buffer register write data figure 10.51 contention between buffer register write and compare match
rev. 2.0, 09/02, page 238 of 658 10.10.8 contention between tgr read and input capture if an input capture signal is generated in the t1 state of a tgr read cycle, the data that is read will be that in the buffer after input capture transfer. figure 10.52 shows the timing in this case. input capture signal read signal address tgr address tgr tgr read cycle t1 t2 m internal data bus x m figure 10.52 contention between tgr read and input capture 10.10.9 contention between tgr write and input capture if an input capture signal is generated in the t2 state of a tgr write cycle, the input capture operation takes precedence and the write to tgr is not performed. figure 10.53 shows the timing in this case.
rev. 2.0, 09/02, page 239 of 658 input capture signal write signal address tcnt tgr write cycle t1 t2 m tgr m tgr address figure 10.53 contention between tgr write and input capture 10.10.10 contention between buffer register write and input capture (h8s/2268 series only) if an input capture signal is generated in the t2 state of a buffer register write cycle, the buffer operation takes precedence and the write to the buffer register is not performed. figure 10.54 shows the timing in this case. input capture signal write signal address tcnt buffer register write cycle t1 t2 n tgr n m m buffer register buffer register address figure 10.54 contention between buffer register write and input capture
rev. 2.0, 09/02, page 240 of 658 10.10.11 contention between overflow/underflow and counter clearing in the h8s/2268 series, if overflow/underflow and counter clearing occur simultaneously, the tcfv/tcfu flag in tsr is not set and tcnt clearing takes precedence. in the h8s/2264 series, if overflow and counter clearing occur simultaneously, the tcfv flag in tsr is not set and tcnt clearing takes precedence. figure 10.55 shows the operation timing when a tgr compare match is specified as the clearing source, and when h'ffff is set in tgr. counter clear signal tcnt input clock tcnt tgf disabled tcfv h'ffff h'0000 figure 10.55 contention between overflow and counter clearing
rev. 2.0, 09/02, page 241 of 658 10.10.12 contention between tcnt write and overflow/underflow in the h8s/2268 series, if there is an up-count or down-count in the t2 state of a tcnt write cycle and overflow/underflow occurs, the tcnt write takes precedence and the tcfv/tcfu flag in tsr is not set. in the h8s/2264 series, if there is an up-count in the t2 state of a tcnt write cycle and overflow occurs, the tcnt write takes precedence and the tcfv flag in tsr is not set. figure 10.56 shows the operation timing when there is contention between tcnt write and overflow. write signal address tcnt address tcnt tcnt write cycle t1 t2 h'ffff m tcnt write data tcfv flag figure 10.56 contention between tcnt write and overflow 10.10.13 multiplexing of i/o pins in the h8s/2268 series, the tclka input pin is multiplexed with the tiocc0 i/o pin, the tclkb input pin with the tiocd0 i/o pin, the tclkc input pin with the tiocb1 i/o pin, and the tclkd input pin with the tiocb2 i/o pin. in the h8s/2264 series, the tclkc input pin is multiplexed with the tiocb1 i/o pin. when an external clock is input, compare match output should not be performed from a multiplexed pin. 10.10.14 interrupts in module stop mode if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source, or the dtc activation source (the h8s/2268 series only). interrupts should therefore be disabled before entering module stop mode.
rev. 2.0, 09/02, page 242 of 658
rev. 2.0, 09/02, page 243 of 658 section 11 8-bit timers the h8s/2268 series has an on-chip 8-bit timer module with four channels (tmr_0, tmr_1, tmr_2 and tmr_3) operating on the basis of an 8-bit counter and an 8-bit reload timer with four channels (tmr_4). the h8s/2264 series has an on-chip 8-bit timer module with two channels (tmr_0 and tmr_1) operating on the basis of an 8-bit counter. 11.1 8-bit timer module (tmr_0, tmr_1, tmr_2 and tmr_3) the 8-bit timer module can be used to count external events and be used as a multifunction timer in a variety of applications, such as generation of counter reset, interrupt requests, and pulse output with an arbitrary duty cycle using a compare-match signal with two registers. 11.1.1 features ? selection of clock sources selected from three internal clocks ( /8, /64, and /8192) and an external clock. ? selection of three ways to clear the counters the counters can be cleared on compare-match a or b, or by an external reset signal. ? timer output controlled by two compare-match signals the timer output signal in each channel is controlled by two independent compare-match signals, enabling the timer to be used for various applications, such as the generation of pulse output or pwm output with an arbitrary duty cycle. ? cascading of the two channels the module can operate as a 16-bit timer using channel 0 (channel 2*) as the upper half and channel 1 (channel 3*) as the lower half (16-bit count mode). channel 1 (channel 3*) can be used to count channel 0 (channel 2*) compare-match occurrences (compare-match count mode). ? multiple interrupt sources for each channel two compare-match interrupts and one overflow interrupt can be requested independently. ? generation of a/d conversion start trigger channel 0 compare-match signal can be used as the a/d conversion start trigger. ? module stop mode can be set at initialization, the 8-bit timer operation is halted. register access is enabled by canceling the module stop mode. note: * supported only by the h8s/2268 series. timh220b_000020020700
rev. 2.0, 09/02, page 244 of 658 figure 11.1 shows a block diagram of the 8-bit timer module (tmr_0 and tmr_1). external clock sources internal clock sources tmr 0 /8 /64 /8192 clock 1 clock 0 compare-match a1 compare-match a0 clear 1 cmia0 cmib0 ovi0 cmia1 cmib1 ovi1 interrupt signals tmo tmri01 internal bus tcora_0 comparator a_0 comparator b_0 tcorb_0 tcsr_0 tcr_0 tcora_1 comparator a_1 tcnt_1 comparator b_1 tcorb_1 tcsr_1 tcr_1 tmci01 tcnt_0 overflow 1 overflow 0 compare-match b1 compare-match b0 tmo1 a/d clock select control logic clear 0 figure 11.1 block diagram of 8-bit timer module legend tcora_0: time constant register a_0 tcorb_0: time constant register b_0 tcnt_0: timer counter_0 tcsr_0: timer control/status register_0 tcr_0: timer control register_0 tcora_1: time constant register a_1 tcorb_1: time constant register b_1 tcnt_1: timer counter_1 tcsr_1: timer control/status register_1 tcr_1: timer control register_1
rev. 2.0, 09/02, page 245 of 658 11.2 input/output pins table 11.1 summarizes the input and output pins of the 8-bit timer module. table 11.1 pin configuration channel name symbol i/o function 0 timer output tmo0 output output controlled by compare-match 1 timer output tmo1 output output controlled by compare-match timer clock input tmci01 input external clock input for the counter common to 0 and 1 timer reset input tmri01 input external reset input for the counter 2 * timer output tmo2 output output controlled by compare-match 3 * timer output tmo3 output output controlled by compare-match timer clock input tmci23 input external clock input for the counter common to 2 and 3 * timer reset input tmri23 input external reset input for the counter note: * supported only by the h8s/2268 series. 11.3 register descriptions the 8-bit timer has the following registers. for details on the module stop register, refer to section 22.1.2, module stop registers a to d (mstpcra to mstpcrd). ? timer counter_0 (tcnt_0) ? time constant register a_0 (tcora_0) ? time constant register b_0 (tcorb_0) ? timer control register_0 (tcr_0) ? timer control/status register_0 (tcsr_0) ? timer counter_1 (tcnt_1) ? time constant register a_1 (tcora_1) ? time constant register b_1 (tcorb_1) ? timer control register_1 (tcr_1) ? timer control/status register_1 (tcsr_1) ? timer counter_2 (tcnt_2)* ? time constant register a_2 (tcora_2)* ? time constant register b_2 (tcorb_2)* ? timer control register_2 (tcr_2)* ? timer control/status register_2 (tcsr_2)* ? timer counter_3 (tcnt_3)* ? time constant register a_3 (tcora_3)*
rev. 2.0, 09/02, page 246 of 658 ? time constant register b_3 (tcorb_3)* ? timer control register_3 (tcr_3)* ? timer control/status register_3 (tcsr_3)* note: * supported only by the h8s/2268 series. 11.3.1 timer counter (tcnt) each tcnt is an 8-bit up-counter. tcnt_0 and tcnt_1 (tcnt_2 and tcnt_3) comprise a single 16-bit register, so they can be accessed together by word access. tcnt increments on pulses generated from an internal or external clock source. this clock source is selected by clock select bits cks2 to cks0 in tcr. tcnt can be cleared by an external reset input signal or compare-match signals a and b. counter clear bits cclr1 and cclr0 in tcr select the method of clearing. when tcnt overflows from h'ff to h'00, the overflow flag (ovf) in tcsr is set to 1. 11.3.2 time constant register a (tcora) tcora is an 8-bit readable/writable register. tcora_0 and tcora_1 (tcora_2 and tcora_3) comprise a single 16-bit register, so they can be accessed together by word access. tcora is continually compared with the value in tcnt. when a match is detected, the corresponding compare-match flag a (cmfa) in tcsr is set. note, however, that comparison is disabled during the t2 state of a tcora write cycle. the timer output from the tmo pin can be freely controlled by the compare-match signal a and the settings of output select bits os1 and os0 in tcsr. the initial value of tcora is h'ff. 11.3.3 time constant register b (tcorb) tcorb is an 8-bit readable/writable register. tcorb_0 and tcorb_1 (tcorb_2 and tcorb_3) comprise a single 16-bit register, so they can be accessed together by word access. tcorb is continually compared with the value in tcnt. when a match is detected, the corresponding compare-match flag b (cmfb) in tcsr is set. note, however, that comparison is disabled during the t2 state of a tcorb write cycle. the timer output from the tmo pin can be freely controlled by the compare-match signal b and the settings of output select bits os1 and os0 in tcsr.
rev. 2.0, 09/02, page 247 of 658 the initial value of tcorb is h'ff. 11.3.4 timer control register (tcr) tcr selects the tcnt clock source and the time at which tcnt is cleared, and controls interrupt requests. bit bit name initial value r/w description 7 cmieb 0 r/w compare-match interrupt enable b selects whether the cmfb interrupt request (cmib) is enabled or disabled when the cmfb flag in tcsr is set to 1. 0: cmfb interrupt request (cmib) is disabled 1: cmfb interrupt request (cmib) is enabled 6 cmiea 0 r/w compare-match interrupt enable a selects whether the cmfa interrupt request (cmia) is enabled or disabled when the cmfa flag in tcsr is set to 1. 0: cmfa interrupt request (cmia) is disabled 1: cmfa interrupt request (cmia) is enabled 5 ovie 0 r/w timer overflow interrupt enable selects whether the ovf interrupt request (ovi) is enabled or disabled when the ovf flag in tcsr is set to 1. 0: ovf interrupt request (ovi) is disabled 1: ovf interrupt request (ovi) is enabled 4 3 cclr1 cclr0 0 0 r/w r/w counter clear 1 and 0 these bits select the method by which tcnt is cleared 00: clearing is disabled 01: cleared on compare-match a 10: cleared on compare-match b 11: cleared on rising edge of external reset input
rev. 2.0, 09/02, page 248 of 658 bit bit name initial value r/w description 2 to 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 2 to 0 the input clock can be selected from three clocks divided from the system clock ( ). when use of an external clock is selected, three types of count can be selected: at the rising edge, the falling edge, and both rising and falling edges. 000: clock input disabled 001: /8 internal clock source, counted on the falling edge 010: /64 internal clock source, counted on the falling edge 011: /8192 internal clock source, counted on the falling edge 100: for channel 0: counted on tcnt1 overflow signal * for channel 1: counted on tcnt0 compare-matcha signal * for channel 2: counted on tcnt3 overflow signal * for channel 3: counted on tcnt2 compare-matcha signal * 101: external clock source, counted at rising edge 110: external clock source, counted at falling edge 111: external clock source, counted at both rising and falling edges note: * if the count input of channel 0 (channel 2) is the tcnt1 (tcnt3) overflow signal and that of channel 1 (channel 3) is the tcnt0 (tcnt2) compare-match signal, no incrementing clock will be generated. do not use this setting.
rev. 2.0, 09/02, page 249 of 658 11.3.5 timer control/status register (tcsr) tcsr indicates status flags and controls compare-match output. ? tcsr_0 bit bit name initial value r/w description 7cmfb 0 r/(w) * 1 compare-match flag b [setting condition] when tcnt = tcorb [clearing condition] read cmfb when cmfb = 1, then write 0 in cmfb. the dtc * 2 is activated by the cmib interrupt and the disel bit = 0 in mrb of the dtc * 2 . 6cmfa 0 r/(w) * 1 compare-match flag a [setting condition] when tcnt = tcora [clearing condition] read cmfa when cmfa = 1, then write 0 in cmfa. the dtc * 2 is activated by the cmia interrupt and disel bit = 0 in mrb of the dtc * 2 . 5ovf 0 r/(w) * 1 timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf 4 adte 0 r/w a/d trigger enable enables or disables a/d converter start requests by compare-match a. 0: a/d converter start requests by compare-match a are disabled 1: a/d converter start requests by compare-match a are enabled
rev. 2.0, 09/02, page 250 of 658 bit bit name initial value r/w description 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output) 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) notes: 1. only 0 can be written to this bit, to clear the flag. 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 251 of 658 ? tcsr_1 and tcsr_3 bit bit name initial value r/w description 7cmfb 0 r/(w) * 1 compare-match flag b [setting condition] when tcnt = tcorb [clearing condition] read cmfb when cmfb = 1, then write 0 in cmfb the dtc * 2 is activated by the cmib interrupt and the disel bit = 0 in mrb of the dtc * 2 . 6cmfa 0 r/(w) * 1 compare-match flag a [setting condition] when tcnt = tcora [clearing condition] read cmfa when cmfa = 1, then write 0 in cmfa the dtc * 2 is activated by the cmia interrupt and the disel bit = 0 in mrb of the dtc * 2 . 5ovf 0 r/(w) * 1 timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf 4 ? 1 ? reserved this bit is always read as 1 and cannot be modified. 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output)
rev. 2.0, 09/02, page 252 of 658 bit bit name initial value r/w description 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) notes: 1. only 0 can be written to this bit, to clear the flag. 2. supported only by the h8s/2268 series. ? tcsr_2 bit bit name initial value r/w description 7cmfb 0 r/(w) * 1 compare-match flag b [setting condition] when tcnt = tcorb [clearing condition] read cmfb when cmfb = 1, then write 0 in cmfb the dtc * 2 is activated by the cmib interrupt and the disel bit = 0 in mrb of the dtc * 2 . 6 cmfa 0 r/(w) * 1 compare-match flag a [setting condition] when tcnt = tcora [clearing condition] read cmfa when cmfa = 1, then write 0 in cmfa the dtc * 2 is activated by the cmia interrupt and the disel bit = 0 in mrb of the dtc * 2 . 5ovf 0 r/(w) * 1 timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf
rev. 2.0, 09/02, page 253 of 658 bit bit name initial value r/w description 4 ? 0r/wreserved this bit is a readable/writable bit, but the write value should always be 0. 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output) 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) notes: 1. only 0 can be written to this bit, to clear the flag. 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 254 of 658 11.4 operation 11.4.1 pulse output figure 11.2 shows an example of arbitrary duty pulse output. 1. set tcr in ccr1 to 0 and cclr0 to 1 to clear tcnt by a tcora compare-match. 2. set os3 to os0 bits in tcsr to b'0110 to output 1 by a tcora compare-match and 0 by a tcorb compare-match. by the above settings, waveforms with the cycle of tcora and the pulse width of tcorb can be output without software intervention. tcnt h'ff counter clear tcora tcorb h'00 tmo figure 11.2 example of pulse output
rev. 2.0, 09/02, page 255 of 658 11.5 operation timing 11.5.1 tcnt incrementation timing figure 11.3 shows the tcnt count timing with internal clock source. figure 11.4 shows the tcnt incrementation timing with external clock source. the pulse width of the external clock for incrementation at single edge must be at least 1.5 status, and at least 2.5 states for incrementation at both edges. the counter will not increment correctly if the pulse width is less than these values. internal clock tcnt input clock tcnt n ? 1 n n + 1 figure 11.3 count timing for internal clock input external clock input pin tcnt input clock tcnt n ? 1 n n + 1 figure 11.4 count timing for external clock input 11.5.2 timing of cmfa and cmfb setting when a compare-match occurs the cmfa and cmfb flags in tcsr are set to 1 by a compare-match signal generated when the tcor and tcnt values match. the compare-match signal is generated at the last state in which the match is true, just before the timer counter is updated. therefore, when tcor and tcnt match, the compare-match signal is not generated until the next incrementation clock input. figure 11.5 shows the timing of cmf flag setting.
rev. 2.0, 09/02, page 256 of 658 tcnt n n + 1 tcor n compare-match signal cmf figure 11.5 timing of cmf setting 11.5.3 timing of timer output when a compare-match occurs when a compare-match occurs, the timer output changes as specified by the output select bits (os3 to os0) in tcsr. figure 11.6 shows the timing when the output is set to toggle at compare- match a. compare-match a signal timer output pin figure 11.6 timing of timer output 11.5.4 timing of compare-match clear when a compare-match occurs tcnt is cleared when compare-match a or b occurs, depending on the setting of the cclr1 and cclr0 bits in tcr. figure 11.7 shows the timing of this operation. n h'00 compare-match signal tcnt figure 11.7 timing of compare-match clear
rev. 2.0, 09/02, page 257 of 658 11.5.5 tcnt external reset timing tcnt is cleared at the rising edge of an external reset input, depending on the settings of the cclr1 and cclr0 bits in tcr. the width of the clearing pulse must be at least 1.5 states. figure 11.8 shows the timing of this operation. clear signal external reset input pin tcnt n h'00 n ? 1 figure 11.8 timing of clearing by external reset input 11.5.6 timing of overflow flag (ovf) setting ovf in tcsr is set to 1 when the timer count overflows (changes from h'ff to h'00). figure 11.9 shows the timing of this operation. ovf overflow signal tcnt h'ff h'00 figure 11.9 timing of ovf setting
rev. 2.0, 09/02, page 258 of 658 11.6 operation with cascaded connection if bits cks2 to cks0 in one of tcr_0 and tcr_1 (tcr_2 and tcr_3) are set to b'100, the 8- bit timers of the two channels are cascaded. with this configuration, a single 16-bit timer can be used (16-bit timer mode) or compare-matches of 8-bit channel 0 (channel 2) can be counted by the timer of channel 1 (channel 3) (compare-match count mode). in the case that channel 0 is connected to channel 1 in cascade, the timer operates as described below. 11.6.1 16-bit count mode when bits cks2 to cks0 in tcr_0 are set to b'100, the timer functions as a single 16-bit timer with channel 0 occupying the upper 8 bits and channel 1 occupying the lower 8 bits. ? setting of compare-match flags ? the cmf flag in tcsr_0 is set to 1 when a 16-bit compare-match occurs. ? the cmf flag in tcsr_1 is set to 1 when a lower 8-bit compare-match occurs. ? counter clear specification ? if the cclr1 and cclr0 bits in tcr_0 have been set for counter clear at compare-match, the 16-bit counter (tcnt_0 and tcnt_1 together) is cleared when a 16-bit compare- match occurs. the 16-bit counter (tcnt_0 and tcnt_1 together) is cleared even if counter clear by the tmri01 pin has also been set. ? the settings of the cclr1 and cclr0 bits in tcr_1 are ignored. the lower 8 bits cannot be cleared independently. ? pin output ? control of output from the tmo0 pin by bits os3 to os0 in tcsr_0 is in accordance with the 16-bit compare-match conditions. ? control of output from the tmo1 pin by bits os3 to os0 in tcsr_1 is in accordance with the lower 8-bit compare-match conditions. 11.6.2 compare-match count mode when bits cks2 to cks0 in tcr_1 are b'100, tcnt_1 counts compare-match a for channel 0. channels 0 and 1 are controlled independently. conditions such as setting of the cmf flag, generation of interrupts, output from the tmo pin, and counter clearing are in accordance with the settings for each channel.
rev. 2.0, 09/02, page 259 of 658 11.7 interrupt sources 11.7.1 interrupt sources and dtc activation the 8-bit timer can generate three types of interrupt: cmia, cmib, and ovi. table 11.2 shows the interrupt sources and priority. each interrupt source can be enabled or disabled independently by interrupt enable bits in tcr. independent signals are sent to the interrupt controller for each interrupt. in the h8s/2268 series, it is also possible to activate the dtc by means of cmia and cmib interrupts. table 11.2 8-bit timer interrupt sources interrupt source description flag dtc activation * interrupt priority cmia0 tcora_0 compare-match cmfa possible high cmib0 tcorb_0 compare-match cmfb possible ovi0 tcnt_0 overflow ovf not possible low cmia1 tcora_1 compare-match cmfa possible high cmib1 tcorb_1 compare-match cmfb possible ovi1 tcnt_1 overflow ovf not possible low cmia2 * tcora_2 compare-match cmfa possible high cmib2 * tcorb_2 compare-match cmfb possible ovi2 * tcnt_2 overflow ovf not possible low cmia3 * tcora_3 compare-match cmfa possible high cmib3 * tcorb_3 compare-match cmfb possible ovi3 * tcnt_3 overflow ovf not possible low note: * supported only by the h8s/2268 series. 11.7.2 a/d converter activation the a/d converter can be activated only by channel 0 compare match a. if the adte bit in tcsr0 is set to 1 when the cmfa flag is set to 1 by the occurrence of channel 0 compare match a, a request to start a/d conversion is sent to the a/d converter. if the 8-bit timer conversion start trigger has been selected on the a/d converter side at this time, a/d conversion is started.
rev. 2.0, 09/02, page 260 of 658 11.8 usage notes 11.8.1 contention between tcnt write and clear if a timer counter clock pulse is generated during the t2 state of a tcnt write cycle, the clear takes priority, so that the counter is cleared and the write is not performed. figure 11.10 shows this operation. address tcnt address internal write signal counter clear signal tcnt n h'00 t 1 t 2 tcnt write cycle by cpu figure 11.10 contention between tcnt write and clear
rev. 2.0, 09/02, page 261 of 658 11.8.2 contention between tcnt write and increment if a timer counter clock pulse is generated during the t2 state of a tcnt write cycle, the write takes priority and the counter is not incremented. figure 11.11 shows this operation. address tcnt address internal write signal tcnt input clock tcnt nm t 1 t 2 tcnt write cycle by cpu counter write data figure 11.11 contention between tcnt write and increment
rev. 2.0, 09/02, page 262 of 658 11.8.3 contention between tcor write and compare-match during the t2 state of a tcor write cycle, the tcor write has priority even if a compare-match occurs and the compare-match signal is disabled. figure 11.12 shows this operation. address tcor address internal write signal tcnt tcor nm t 1 t 2 tcor write cycle by cpu tcor write data n n + 1 compare-match signal inhibited figure 11.12 contention between tcor write and compare-match 11.8.4 contention between compare-matches a and b if compare-matches a and b occur at the same time, the 8-bit timer operates in accordance with the priorities for the output states set for compare-match a and compare-match b, as shown in table 11.3. table 11.3 timer output priorities output setting priority toggle output high 1 output 0 output no change low
rev. 2.0, 09/02, page 263 of 658 11.8.5 switching of internal clocks and tcnt operation tcnt may increment erroneously when the internal clock is switched over. table 11.4 shows the relationship between the timing at which the internal clock is switched (by writing to the cks1 and cks0 bits) and the tcnt operation when the tcnt clock is generated from an internal clock, the falling edge of the internal clock pulse is detected. if clock switching causes a change from high to low level, as shown in no. 3 in table 11.4, a tcnt clock pulse is generated on the assumption that the switchover is a falling edge. this increments tcnt. erroneous incrementation can also happen when switching between internal and external clocks. table 11.4 switching of internal clock and tcnt operation no. timing of switchover by means of cks1 and cks0 bits tcnt clock operation 1 switching from low to low * 1 clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 2 switching from low to high * 2 tcnt h'ff counter clear tcora tcorb h'00 tmo
rev. 2.0, 09/02, page 264 of 658 no. timing of switchover by means of cks1 and cks0 bits tcnt clock operation 3 switching from high to low * 3 clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite n n + 1 n + 2 * 4 4 switching from high to high clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 n + 2 notes: 1. includes switching from low to stop, and from stop to low. 2. includes switching from stop to high. 3. includes switching from high to stop. 4. generated on the assumption that the switchover is a falling edge; tcnt is incremented. 11.8.6 contention between interrupts and module stop mode if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dtc activation source. interrupts should therefore be disabled before entering module stop mode.
rev. 2.0, 09/02, page 265 of 658 11.9 8-bit reload timer (tmr_4) (h8s/2268 series only) the 8-bit reload timer comprises an 8-bit up-counter with four channels, and has two functions, the interval function and automatic reload function. 11.9.1 features ? selection of clock sources ? selected from 14 internal clocks ( /32768, /8192, /2048, /512, /128, /32, /8, /2, sub /256, sub /128, sub /64, sub /32, sub /8 and sub /2) and an external clock. ? interrupts requested by counter overflow ? operation with cascaded connection (the lower the channel number, the higher the bit in the connected timer) ? connecting two timers (channels 4 and 5, channels 5 and 6, or channels 6 and 7): the module operates as a 16-bit timer ? connecting three timers (channels 4 to 6 or channels 5 to 7): the module operates as a 24- bit timer ? connecting four timers (channels 4 to 7): the module operates as a 32-bit timer ? module stop mode can be set ? at initialization, the 8-bit reload timer is halted. register access is enabled by canceling the module stop mode.
rev. 2.0, 09/02, page 266 of 658 figure 11.13 shows a block diagram of the 8-bit reload timer. tcr_4 clock select tcnt_4 tlr_4 ovi4 ovi5 ovi6 ovi7 tcr_5 clock select tcnt_5 tlr_5 tcr_6 clock select tcnt_6 tlr_6 tcr_7 clock select tcnt_7 tlr_7 interrupt contorol bus interface internal clock /2 /8 /32 /128 /512 /2048 /8192 /32768 sub /2 sub /8 sub /32 sub /64 sub /128 sub /256 internal bus external clock tmci4 reload tcr_4 : timer control register 4 tcnt_4 : timer counter 4 tlr_4 : timer reload register 4 tcr_5 : timer control register 5 tcnt_5 : timer counter 5 tlr_5 : timer reload register 5 tcr_6 : timer control register 6 tcnt_6 : timer counter 6 tlr_6 : timer reload register 6 tcr_7 : timer control register 7 tcnt_7 : timer counter 7 tlr_7 : timer reload register 7 module bus figure 11.13 block diagram of 8-bit reload timer 11.9.2 input/output pins the following table shows the pin configuration for the 8-bit timer module. name symbol i/o function timer clock input pin tmci4 input external clock input for the counter note: voltage applied to the tmci4 input pin should be within the range, avss tmci4 avcc.
rev. 2.0, 09/02, page 267 of 658 11.10 register descriptions the 8-bit reload timer has the following registers. for details on the module stop control register, refer to section 22.1.2, module stop control registers a to d (mstpcra to mstpcrd). ? timer control register (tcr) ? timer counter (tcnt) ? timer reload register (tlr) tcnt or tlr can operate as a 16-bit timer using tcnt_4 or tlr_4 (tcnt_6 or tlr_6) as the upper half and tcnt_5 or tlr_5 (tcnt_7 or tlr_7) as the lower half. 11.10.1 timer control registers 4 to 7 (tcr_4 to tcr_7) tcr selects the automatic reload function and tcnt clock source, and controls interrupt requests. bit bit name initial value r/w description 7 arsl 0 r/w automatic reload function select selects the automatic reload function 0: the interval function is selected 1: the automatic reload function is selected 6ovf 0 r/(w) * timer overflow flag indicates that tcnt overflows from h'ff to h'00. 0: [clearing condition] read ovf when ovf = 1, then write 0 in ovf 1: [setting condition] when tcnt overflows from h'ff to h'00 5 ovie 0 r/w timer overflow interrupt enable selects whether the ovf interrupt request (ovi) is enabled or disabled when the ovf flag in tcsr is set to 1. 0: ovf interrupt request (ovi) is disabled 1: ovf interrupt request (ovi) is enabled 4, 3 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
rev. 2.0, 09/02, page 268 of 658 bit bit name initial value r/w description clock select 2 to 0 the input clock can be selected from internal clocks and an external clock, which are divided from the system clock ( ) or subclock ( sub ). channel4 channel5 channel6 channel7 000: /32768 /8192 /32768 /8192 001: /2048 /512 /2048 /512 010: /128 /32 /128 /32 011: /8 /2 /8 /2 100: sub /256 sub /128 sub /256 sub /128 101: sub /64 sub /32 sub /64 sub /32 110: sub /8 sub /2 sub /8 sub /2 2 to 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w 111: tcnt_5 overflow tcnt_6 overflow tcnt_7 overflow count of the rising clock of the external clock. note: * only a 0 can be written to this bit, to clear the flag. 11.10.2 timer counters 4 to 7 (tcnt4 to tcnt7) each tcnt is an 8-bit readable up-counter and increments on clock pulses generated from an internal or external clock source. this clock source is selected by clock select bits cks2 to cks0 in tcr tcnt_4 and tcnt_5, or tcnt_6 and tcnt_7 comprise a single 16-bit register, and can be accessed simultaneously by word access. when tcnt overflows from h'ff to h'00, the overflow flag (ovf) in tcr is set to 1. tcnt is initialized to h'00 by a reset or in hardware standby mode. 11.10.3 time reload registers 4 to 7 (tlr_4 to tlr_7) each tlr is an 8-bit writable register and sets a reload value for tcnt. when a reload value is set to tlr, the value is simultaneously load to tcnt and incrementation starts from the value. when tcnt overflows during automatic reload operation, the tlr value is written to tcnt. therefore, the overflow cycle can be set within the range from 1 to 256 input clock cycles. tlr_4 and tlr_5, or tlr_6 and tlr_7 comprise a single 16-bit register, and can be accessed simultaneously by word access.
rev. 2.0, 09/02, page 269 of 658 tlr is initialized to h'00 by a reset or in hardware standby mode. 11.11 operation 11.11.1 interval timer operation when the arsl bit in tcr is set to 0, the timer operates as an interval timer. after a module stop mode is canceled, the timer continues incrementation as an interval timer without stopping because tcnt is initialized to h'00 and tlr is cleared to 0 by a reset. the input clock source can be selected from 14 internal clocks output from the prescaler unit and an external clock from the tmci4 input pin, using the cks2 to cks0 bits in tcr. when a clock is input after the tcnt value has been h'ff, the timer overflows and ovf in tcr is set to 1. at this time, if ovie in tcr is 1, an interrupt is generated. when an overflow occurs, the tcnt count value is cleared to h'00 and tcnt restarts incrementation. if a value is set to tlr during interval timer operation, the value is also written to tcnt. this operation timing is shown in figure 11.14. h'ff h'00 time overflow overflow overflow overflow mstpd5=0 arsl=0 ovf ovf ovf ovf tcnt value ovf: timer overflow interrupt request generation figure 11.14 operation in interval timer mode
rev. 2.0, 09/02, page 270 of 658 11.11.2 automatic reload timer operation when the arsl bit in tcr is set to 1, the timer operates as an automatic reload timer. when a reload value is set to tlr, the value is also loaded to tcnt simultaneously, and tcnt starts incrementation from the value. if a clock is input after the tcnt count value reaches h'ff, the timer overflows, the tlr value is written to tcnt, and incrementation is continued from the value. therefore, the overflow cycle can be set within the range from 1 to 256, using a tlr value. clock sources and interrupts in automatic reload operation are the same as those in interval operation. if tlr is re-set during automatic reload operation, the value is also set to tcnt. this operation timing is shown in figure 11.15. h'ff h'80 h'40 h'00 tcnt value mstpd5=0 arsl=0 arsl=1 tlr setting (h'80)) tlr setting (h'40) ovf ovf ovf ovf ovf ovf: timer overflow interrupt request generation ovf time overflow overflow overflow overflow overflow overflow figure 11.15 operation in automatic reload timer mode 11.11.3 cascaded connection ? read of tcnt the channel relationship for cascaded connection is shown in figure 11.16. when accessing beyond the word area, for example, when a cascaded connection including channels 5 and 6 is created as shown in (3), and (6) to (8) in the figure, the counter value of the lower channel is read when tcnt5 is read, and the data is stored in the tcnt register. for case (7) where channels 5 to 7 are cascaded, the counter values of channels 6 and 7 are read when tcnt5 is read, and the data is stored in tcnt6/7 registers. accordingly, when reading cascaded tcnt, read from the upper channel. for a word connection, access in word units.
rev. 2.0, 09/02, page 271 of 658 cascaded connection upper lower 1 2 3 4 5 6 7 8 channel 4 channel 4 channel 4 channel 4 channel 4 channel 4 channel 4 channel 4 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 channel 5 channel 6 channel 7 figure 11.16 channel relationship of cascaded connection ? write to tlr when writing to the cascaded tlr, even if a single channel of tlr is written, the system regards that the entire channels of the cascaded tlr are rewritten. at this point in time, the value in the entire cascaded tlr is loaded into the corresponding tcnt. the timer operation starts at the tlr value that is most-recently written in tlr access cycles. ? operation clock although each channel usually operates on an individual clock, a cascaded channel operates on the same clock. the operation clock for the lowest cascaded channel is used as a common clock of each channel. in this case, the setting for the clocks of the channels other than the lowest channel is disabled.
rev. 2.0, 09/02, page 272 of 658 ? automatic reload function select and operation timing although the automatic reload function is usually set and implemented in individual channel, a cascaded channel operates according to the setting for the automatic reload function of the highest channel. in this case, the automatic reload function settings for the channels other than the highest channel are disabled. when the automatic reload function is enabled for cascaded channel, the tlr setting value of each channel is automatically reloaded simultaneously in the reload timing of the highest channel. ? timer overflow flag (ovf) although an ovf is usually set to an individual channel independently, an ovf is set to the highest channel of a cascaded channel. in this case, ovfs of the channels other than that of the highest channel is disabled. 11.12 usage notes 11.12.1 conflict between write to tlr and count up/automatic reload even if a count up occurs in the t2 state during tlr write cycles, the counter is not incremented and tlr write (load to tcnt) is carried out instead (as in figure 11.11). likewise, if an automatic reload occurs during write cycles, tlr write (load to tcnt) is carried out instead. 11.12.2 switchover of the internal clock and tcnt operation depending on the timing which the internal clock is switched, tcnt may be incremented (see table 11.4). likewise, when the clock pulse is changed ( and sub ), tcnt may be incremented, and may not in some cases. therefore, when the internal clock is changed, resume timer operation by resetting tlr (write h'00 to tlr when the interval timer is in operation). 11.12.3 interrupt during module stop when module stop mode is entered with an interrupt being requested, the cause of an interrupt to the cpu cannot be cleared. enter module stop mode after, for example, disabling an interrupt request.
rev. 2.0, 09/02, page 273 of 658 section 12 watchdog timer the watchdog timer (wdt) is an 8-bit timer that can generate an internal reset signal for this lsi if a system crash prevents the cpu from writing to the timer counter, thus allowing it to overflow. when this watchdog function is not needed, the wdt can be used as an interval timer. in interval timer operation, an interval timer interrupt is generated each time the counter overflows. the block diagram of the wdt is shown in figures 12.1 to 12.3. 12.1 features ? selectable from eight counter input clocks for wdt_0 selectable from 16 counter input clocks for wdt_1 in the h8s/2268 series selectable from 26 counter input clocks for wdt_1 in the h8s/2264 series ? switchable between watchdog timer mode and interval timer mode in watchdog timer mode ? if the counter in wdt_0 overflows, it is possible to select whether this lsi is internally reset or not. ? if the counter in wdt_1 overflows, it is possible to select whether this lsi is internally reset or the internal nmi interrupt is generated. in interval timer mode ? if the counter overflows, the wdt generates an interval timer interrupt (wovi). wdt0105b_000020020700
rev. 2.0, 09/02, page 274 of 658 overflow interrupt control wovi (interrupt request signal) internal reset signal * reset control rstcsr tcnt_0 tscr_0 /2 /64 /128 /512 /2048 /8192 /32768 /131072 clock clock select internal clock sources bus interface module bus tcsr_0 tcnt_0 rstcsr note: * the type of internal reset signal depends on a register setting. : timer control/status register0 : timer counter0 : reset control/status register wdt legend internal bus figure 12.1 block diagram of wdt_0 overflow interrupt control wovi (interrupt request signal) internal nmi (interrupt request signal) internal reset signal * reset control tcnt_1 tscr_1 /2 /64 /128 /512 /2048 /8192 /32768 /131072 sub/2 sub/4 sub/8 sub/16 sub/32 sub/64 sub/128 sub/256 clock clock select internal clock sources bus interface module bus internal bus wdt tcsr_1 tcnt_1 note: * the type of internal reset signal depends on a register setting. : timer control/status register1 : timer counter1 legend figure 12.2 block diagram of wdt_1 for h8s/2268 series
rev. 2.0, 09/02, page 275 of 658 tcnt_1 module bus internal bus internal clock /2 /64 /128 /512 /2048 /8192 /32768 /131072 sub /120 sub /240 sub /480 sub /960 sub /1920 sub /3840 sub /7680 sub /15360 sub /2 sub /4 sub /8 sub /16 sub /32 sub /64 sub /128 sub /256 sub /512 sub /1024 overflow clock interrupt control clock selection reset control wovi1 (interrupt request signal) internal nmi (interrupt request signal) internal reset signal * legend tcsr_1: timer control/status register 1 tcnt_1: timer counter 1 note: * an internal reset signal is generated by the register setting. tscr_1 bus interface wdt figure 12.3 block diagram of wdt_1 for h8s/2264 series 12.2 register descriptions the wdt has the following three registers. to prevent accidental overwriting, tcsr, tcnt, and rstcsr have to be written to by a different method to normal registers. for details, refer to section 12.5.1, notes on register access. for detained description on the system control register, refer to section 5.3.1, system control register (syscr). ? timer counter (tcnt) ? timer control/status register (tcsr) ? reset control/status register (rstcsr) 12.2.1 timer counter (tcnt) tcnt is an 8-bit readable/writable up-counter. tcnt is initialized to h'00 when the tme bit in tcsr is cleared to 0.
rev. 2.0, 09/02, page 276 of 658 12.2.2 timer control/status register (tcsr) tcsr functions include selecting the clock source to be input to tcnt and the timer mode. ? tcsr_0 bit bit name initial value r/w description 7ovf 0 r/(w) * 1 overflow flag indicates that tcnt has overflowed. only a 0 can be written to this bit, to clear the flag. [setting condition] when tcnt overflows (changes from h'ff to h'00) when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset. [clearing conditions] cleared by reading tcsr * 2 when ovf = 1, then writing 0 to ovf 6wt/ it 0 r/w timer mode select selects whether the wdt is used as a watchdog timer or interval timer. 0: interval timer mode 1: watchdog timer mode 5 tme 0 r/w timer enable when this bit is set to 1, tcnt starts counting. when this bit is cleared, tcnt stops counting and is initialized to h'00. 4, 3 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
rev. 2.0, 09/02, page 277 of 658 bit bit name initial value r/w description 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 0 to 2 selects the clock source to be input to tcnt. the overflow frequency * 3 for = 20 mhz is enclosed in parentheses. 000: clock /2 (frequency: 25.6 s) 001: clock /64 (frequency: 819.2 s) 010: clock /128 (frequency: 1.6 ms) 011: clock /512 (frequency: 6.6 ms) 100: clock /2048 (frequency: 26.2 ms) 101: clock /8192 (frequency: 104.9 ms) 110: clock /32768 (frequency: 419.4 ms) 111: clock /131072 (frequency: 1.68 s) notes: 1. only 0 can be written, for flag clearing. 2. when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice. 3. the overflow period is the time from when tcnt starts counting up from h?00 until overflow occurs. ? tcsr_1 bit bit name initial value r/w description 7ovf 0 r/(w) * 1 overflow flag indicates that tcnt has overflowed. only a 0 can be written to this bit, to clear the flag. [setting condition] when tcnt overflows (changes from h?ff to h?00) when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset. [clearing conditions] cleared by reading tcsr * 2 when ovf = 1, then writing 0 to ovf 6wt/ it 0 r/w timer mode select selects whether the wdt is used as a watchdog timer or interval timer. 0: interval timer mode 1: watchdog timer mode
rev. 2.0, 09/02, page 278 of 658 bit bit name initial value r/w description 5 tme 0 r/w timer enable when this bit is set to 1, tcnt starts counting. when this bit is cleared, tcnt stops counting and is initialized to h'00. 4 pss 0 r/w prescaler select selects the clock source input to tcnt of wdt_1 0: tcnt counts divided clock of -base prescaler (psm). 1: tcnt counts divided clock of sub -base prescaler (pss) 3rst /nmi 0 r/w reset or nmi (rest/ nmi ) 0: an nmi interrupt is requested. 1: reset is requested. 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 0 to 2 selects the clock source to be input to tcnt. the overflow frequency * 3 for = 20 mhz is enclosed in parentheses. when pss = 0: 000: clock /2 (frequency: 25.6 s) 001: clock /64 (frequency: 819.2 s) 010: clock /128 (frequency: 1.6 ms) 011: clock /512 (frequency: 6.6 ms) 100: clock /2048 (frequency: 26.2 ms) 101: clock /8192 (frequency: 104.9 ms) 110: clock /32768 (frequency: 419.4 ms) 111: clock /131072 (frequency: 1.68 s) when pss = 1: see table 12.1, clock selection when pss = 1. notes: 1. only 0 can be written, for flag clearing. 2. when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice 3. the overflow period is the time from when tcnt starts counting up from h'00 until overflow occurs.
rev. 2.0, 09/02, page 279 of 658 table 12.1 clock selection when pss = 1. h8s/2268 series h8s/2264 series when pss = 1: 000: clock sub /2 (frequency: 15.6 ms) 001: clock sub /4 (frequency: 31.3 ms) 010: clock sub /8 (frequency: 62.5 ms) 011: clock sub /16 (frequency: 125 ms) 100: clock sub /32 (frequency: 250 ms) 101: clock sub /64 (frequency: 500 ms) 110: clock sub /128 (frequency: 1 s) 111: clock sub /256 (frequency: 2 s) clock selection differs according to the combination of the subcks1 and subcks0 bits in sckcr2 and the pss bit. when pss = 1, subcks1=0, subcks0=0, 000: clock sub /2 (frequency: 15.6 ms) 001: clock sub /4 (frequency: 31.3 ms) 010: clock sub /8 (frequency: 62.5 ms) 011: clock sub /16 (frequency: 125 ms) 100: clock sub /32 (frequency: 250 ms) 101: clock sub /64 (frequency: 500 ms) 110: clock sub /128 (frequency: 1 s) 111: clock sub /256 (frequency: 2 s) when pss = 1, subcks1=0, subcks0=1, 000: clock sub /8 (frequency: 62.5 ms) 001: clock sub /16 (frequency: 125 ms) 010: clock sub /32 (frequency: 250 ms) 011: clock sub /64 (frequency: 500 ms) 100: clock sub /128 (frequency: 1 s) 101: clock sub /256 (frequency: 2 s) 110: clock sub /512 (frequency: 4 s) 111: clock sub /1024 (frequency: 8 s) when pss = 1, subcks1=1, subcks0=0, 000: clock sub /120 (frequency: 938 ms) 001: clock sub /240 (frequency: 1.9 s) 010: clock sub /480 (frequency: 3.8 s) 011: clock sub /960 (frequency: 7.5 s) 100: clock sub /1920 (frequency: 15 s) 101: clock sub /3840 (frequency: 30 s) 110: clock sub /7680 (frequency: 1 min) 111: clock sub /15360 (frequency: 2 min) note: * a value in parentheses represents an overflow period when sub = 32.768 khz. the overflow period is the time from when tcnt starts connoting up from h'00 until overflow occurs.
rev. 2.0, 09/02, page 280 of 658 12.2.3 reset control/status register (rstcsr) (only wdt_0) rstcsr controls the generation of the internal reset signal when tcnt overflows, and selects the type of internal reset signal. rstcsr is initialized to h'1f by a reset signal from the res pin, and not by the wdt internal reset signal caused by overflows. bit bit name initial value r/w description 7wovf0 r/(w) * watchdog overflow flag this bit is set when tcnt overflows in watchdog timer mode. this bit cannot be set in interval timer mode, and only 0 can be written, to clear the flag. [setting condition] set when tcnt overflows (changed from h'ff to h'00) in watchdog timer mode [clearing condition] cleared by reading rstcsr when wovf = 1, and then writing 0 to wovf 6 rste 0 r/w reset enable specifies whether or not a reset signal is generated in the chip if tcnt overflows during watchdog timer operation. 0: reset signal is not generated even if tcnt overflows (though this lsi is not reset, tcnt and tcsr in wdt are reset) 1: reset signal is generated if tcnt overflows 5 ? 0r/wreserved this bit can be read from and written to. however, the write value should always be 0. 4 to 0 ? 1 ? reserved these bits are always read as 1 and cannot be modified. note: * only 0 can be written, to clear the flag.
rev. 2.0, 09/02, page 281 of 658 12.3 operation 12.3.1 watchdog timer mode to use the wdt as a watchdog timer, set the wt/ it bit in tcsr and the tme bit to 1. software must prevent tcnt overflows by rewriting the tcnt value (normally be writing h'00) before overflows occurs. thus, tcnt does not overflow while the system is operating normally. when the wdt is used as a watchdog timer and the rste bit in rstcsr of wdt_0 is set to 1, and if tcnt overflows without being rewritten because of a system malfunction or other error, an internal reset signal for this lsi is output for 518 system clocks. when the rst/ nmi bit in tcsr of wdt_1 is set to 1, and if tcnt overflows, the internal reset signal is output for 516 system clock periods. when the rst/ nmi bit is cleared to 0, an nmi interrupt request is generated (for 515 or 516 system clock periods when the clock source is set to sub (pss = 1)). an internal reset request from the watchdog timer and a reset input from the res pin are both treated as having the same vector. if a wdt internal reset request and the res pin reset occur at the same time, the res pin reset has priority and the wovf bit in rstcsr is cleared to 0. an nmi request from the watchdog timer and an interrupt request from the nmi pin are both treated as having the same vector. so, avoid handling an nmi request from the watchdog timer and an interrupt request from the nmi pin at the same time.
rev. 2.0, 09/02, page 282 of 658 tcnt value h'00 time h'ff wt/ =1 tme=1 write h'00' to tcnt wt/ =1 tme=1 write h'00' to tcnt 518 system clock (wdt0) 515/516 system clock (wdt1) internal reset signal * wt/ tme note: * in the case of wdt_0, the internal reset signal is generated only when the rste bit is set to 1. in the case of wdt_1,either the internal reset or the nmi interrupt is generated. overflow internal reset is generated wovf=1 : timer mode select bit : timer enable bit legend figure 12.4 watchdog timer mode operation 12.3.2 interval timer mode to use the wdt as an internal timer, set the wt/ it and tme bits in tcsr to 0. when the wdt is used as an interval timer, an interval timer interrupt (wovi) is generated each time the tcnt overflows. therefore, an interrupt can be generated at intervals. when the tcnt overflows in interval timer mode, an interval timer interrupt (wovi) is requested at the time the ovf bit of the tcsr is set to 1.
rev. 2.0, 09/02, page 283 of 658 tcnt value h'00 time h'ff wt/ =0 tme=1 wovi overflow overflow overflow overflow legend wovi: interval timer interrupt request generation wovi wovi wovi figure 12.5 interval timer mode operation 12.3.3 timing of setting overflow flag (ovf) the ovf flag is set to 1 if tcnt overflows during interval timer operation. at the same time, an interval timer interrupt (wovi) is requested. this timing is shown in figure 12.6. tcnt h'ff h'00 ovf 1 1 1 overflow signal (internal signal) figure 12.6 timing of ovf setting
rev. 2.0, 09/02, page 284 of 658 12.3.4 timing of setting watchdog timer overflow flag (wovf) with wdt_0 the wovf bit in rstcsr is set to 1 if tcnt overflows in watchdog timer mode. if tcnt overflows while the rste bit in rstcsr is set to 1, an internal is generated for the entire chip. this timing is illustrated in figure 12.7. tcnt h'ff h'00 overflow signal (internal signal) wovf internal reset signal 518 states (wdt_0) 515/516 states (wdt_1) figure 12.7 timing of wovf setting 12.4 interrupt sources during interval timer mode operation, an overflow generates an interval timer interrupt (wovi). the interval timer interrupt is requested whenever the ovf flag is set to 1 in tcsr. ovf must be cleared to 0 in the interrupt handling routine. if an nmi request has been chosen in the watchdog timer mode, an nmi request is generated when a tcnt overflow occurs. table 12.2 wdt interrupt source name interrupt source interrupt flag wovi tcnt overflow (interval timer mode) ovf nmi tcnt overflow (watchdog timer mode) ovf
rev. 2.0, 09/02, page 285 of 658 12.5 usage notes 12.5.1 notes on register access the watchdog timer?s tcnt and tcsr registers differ from other registers in being more difficult to write to. the procedures for writing to and reading these registers are given below. writing to tcnt, tcsr, and rstcsr these registers must be written to by a word transfer instruction. they cannot be written to by a byte transfer instruction. tcnt and tcsr both have the same write address. therefore, the relative condition shown in figure 12.8 needs to be satisfied in order to write to tcnt or tcsr. the transfer instruction writes the lower byte data to tcnt or tcsr. the upper byte must be h?5a for writing to tcnt, and h?a5 for writing to tcsr. to write to rstcsr, execute a word transfer instruction for address h?ff76. a byte transfer instruction cannot write to rstcsr. the method of writing 0 to the ovf bit differs from that of writing to the rste bit. to write 0 to the wovf bit, satisfy the condition shown in figure 12.8. if satisfied, the transfer instruction clears the wovf bit to 0, but has no effect on the rste bit. to write to the rste and rsts bits, satisfy the condition shown in figure 12.8. if satisfied, the transfer instruction writes the values in bit 6 of the lower byte into the rste bit, but has no effect on the wovf bit. tcnt write writing to rste and rsts bits tcsr write writing 0 to wovf bit address: address: 15 8 7 0 h'5a h'ff74 h'ff76 write data 15 8 7 0 h'a5 h'ff74 h'ff76 write data or h'00 figure 12.8 writing to tcnt and tcsr (example for wdt_0) reading tcnt, tcsr and rstcsr (wdt _ _ _ _ 0) these registers are read in the same way as other registers. the read addresses are h'ff74 for tcsr and h'ff77 for rstcsr.
rev. 2.0, 09/02, page 286 of 658 12.5.2 contention between timer counter (tcnt) write and increment if a timer counter clock pulse is generated during the t2 state of a tcnt write cycle, the write takes priority and the timer counter is not incremented. figure 12.9 shows this operation. address internal write signal tcnt input clock tcnt nm t 1 t 2 tcnt write cycle counter write data figure 12.9 contention between tcnt write and increment 12.5.3 changing value of cks2 to cks0 if bits cks0 to cks2 in tcsr are written to while the wdt is operating, errors could occur in the incrementation. software must be used to stop the watchdog timer (by clearing the tme bit to 0) before changing the value of bits cks0 to cks2. 12.5.4 switching between watchdog timer mode and interval timer mode if the mode is switched from watchdog timer to interval timer while the wdt is operating, errors could occur in the incrementation. software must be used to stop the watchdog timer (by clearing the tme bit to 0) before switching the mode. 12.5.5 internal reset in watchdog timer mode this lsi is not reset internally if tcnt overflows while the rste bit is cleared to 0 during watchdog timer operation, however tcnt_0 and tcsr_0 of the wdt_0 are reset.
rev. 2.0, 09/02, page 287 of 658 tcnt, tcsr, or rstcr cannot be written to for 132 states following an overflow. during this period, any attempt to read the wovf flag is not acknowledged. accordingly, wait 132 states after overflow to write 0 to the wovf flag for clearing. 12.5.6 ovf flag clearing in interval timer mode when the ovf flag setting conflicts with the ovf flag reading in interval timer mode, writing 0 to the ovf bit may not clear the flag even though the ovf bit has been read while it is 1. if there is a possibility that the ovf flag setting and reading will conflict, such as when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice before writing 0 to the ovf bit to clear the flag.
rev. 2.0, 09/02, page 288 of 658
rev. 2.0, 09/02 page 289 of 658 section 13 serial communication interface (sci) this lsi has three independent serial communication interface (sci) channels. the sci can handle both asynchronous and clocked synchronous serial communication. serial data communication can be carried out using standard asynchronous communication chips such as a universal asynchronous receiver/transmitter (uart) or an asynchronous communication interface adapter (acia). a function is also provided for serial communication between processors (multiprocessor communication function). the sci also supports an ic card (smart card) interface conforming to iso/iec 7816-3 (identification card) as a serial communication interface extension function. 13.1 features ? choice of asynchronous or clocked synchronous serial communication mode ? full-duplex communication capability the transmitter and receiver are mutually independent, enabling transmission and reception to be executed simultaneously. double-buffering is used in both the transmitter and the receiver, enabling continuous transmission and continuous reception of serial data. ? on-chip baud rate generator allows any bit rate to be selected external clock can be selected as a transfer clock source (except for in smart card interface mode). ? choice of lsb-first or msb-first transfer (except in the case of asynchronous mode 7-bit data) ? four interrupt sources transmit-end, transmit-data-empty, receive-data-full, and receive error ? that can issue requests. the transmit-data-empty interrupt and receive data full interrupts can be used to activate the data transfer controller (dtc) (h8s/2268 series only). ? module stop mode can be set asynchronous mode ? data length: 7 or 8 bits ? stop bit length: 1 or 2 bits ? parity: even, odd, or none ? receive error detection: parity, overrun, and framing errors ? break detection: break can be detected by reading the rxd pin level directly in the case of a framing error sci0025b_000020020700
rev. 2.0, 09/02, page 290 of 658 ? average transfer rate generator (sci_0): 720 kbps, 460.784 kbps, or 115.196 kbps can be selected at 16 mhz operation. ? transfer rate clock can be input from the tpu (sci_0). ? communications between multi-processors are possible. clocked synchronous mode ? data length: 8 bits ? receive error detection: overrun errors detected smart card interface ? automatic transmission of error signal (parity error) in receive mode ? error signal detection and automatic data retransmission in transmit mode ? direct convention and inverse convention both supported
rev. 2.0, 09/02 page 291 of 658 figure 13.1 shows a block diagram of the sci_0, and figure 13.2 shows that of the sci1 and sci_2. rxd0 txd0 sck0 tei txi rxi eri scmr ssr scr smr semr brr rdr tsr rsr tdr tioca1 tclka tioca2 tpu external clock transmission/ reception control baud rate generator module data bus bus interface parity generation internal data bus clock /4 /16 /64 rsr rdr tsr tdr smr : receive shift register : receive data register : transmit shift register : transmit data register : serial mode register scr ssr scmr brr semr : serial control register : serial status register : smart card mode register : bit rate register : serial expansion mode register legend parity check 10.667mhz operation 115.152kbps 460.606kbps 16mhz operation 115.196kbps 460.784kbps 720kbps average transfer rate generator figure 13.1 block diagram of sci_0
rev. 2.0, 09/02, page 292 of 658 rxd txd sck clock external clock /4 /16 /64 tei txi rxi eri rsr rdr tsr tdr smr scr ssr scmr brr : receive shift register : receive data register : transmit shift register : transmit data register : serial mode register : serial control register : serial status register : smart card mode register : bit rate register scmr ssr scr smr transmission/ reception control baud rate generator brr module data bus bus interface rdr tsr rsr parity generation parity check legend tdr internal data bus figure 13.2 block diagram of sci_1 or sci_2
rev. 2.0, 09/02 page 293 of 658 13.2 input/output pins table 13.1 shows the pin configuration for each sci channel. table 13.1 pin configuration channel pin name * i/o function sck0 i/o sci0 clock input/output rxd0 input sci0 receive data input 0 txd0 output sci0 transmit data output sck1 i/o sci1 clock input/output rxd1 input sci1 receive data input 1 txd1 output sci1 transmit data output sck2 i/o sci2 clock input/output rxd2 input sci2 receive data input 2 txd2 output sci2 transmit data output note: * pin names sck, rxd, and txd are used in the text for all channels, omitting the channel designation. 13.3 register descriptions the sci has the following registers for each channel. for details on register addresses and register states during each process, refer to appendix a, internal i/o register. the serial mode register (smr), serial status register (ssr), and serial control register (scr) are described separately for normal serial communication interface mode and smart card interface mode because their bit functions differ in part. ? receive shift register (rsr) ? receive data register (rdr) ? transmit data register (tdr) ? transmit shift register (tsr) ? serial mode register (smr) ? serial control register (scr) ? serial status register (ssr) ? smart card mode register (scmr) ? bit rate register (brr) other than the above registers, sci_0 has the following register. ? serial expansion mode register (semr0)
rev. 2.0, 09/02, page 294 of 658 13.3.1 receive shift register (rsr) rsr is a shift register that is used to receive serial data input to the rxd pin and convert it into parallel data. when one byte of data has been received, it is transferred to rdr automatically. rsr cannot be directly accessed by the cpu. 13.3.2 receive data register (rdr) rdr is an 8-bit register that stores received data. when the sci has received one byte of serial data, it transfers the received serial data from rsr to rdr, where it is stored. after this, rsr is receive-enabled. as rsr and rdr function as a double buffer in this way, continuous receive operations are possible. after confirming that the rdrf bit in ssr is set to 1, read rdr only once. rdr cannot be written to by the cpu. rdr is initialized to h'00 by a reset, in standby mode, watch mode,subactive mode, subsleep mode or module stop mode. 13.3.3 transmit data register (tdr) tdr is an 8-bit register that stores data for transmission. when the sci detects that tsr is empty, it transfers the transmit data written in tdr to tsr and starts transmission. the double-buffered structure of tdr and tsr enables continuous serial transmission. if the next transmit data has already been written to tdr during serial transmission, the sci transfers the written data to tsr to continue transmission. although tdr can be read or written to by the cpu at all times, to achieve reliable serial transmission, write transmit data to tdr only once after confirming that the tdre bit in ssr is set to 1. tdr is initialized to h'ff by a reset, in standby mode, watch mode, subactive mode, subsleep mode or module stop mode. 13.3.4 transmit shift register (tsr) tsr is a shift register that transmits serial data. to perform serial data transmission, the sci first transfers transmit data from tdr to tsr, then sends the data to the txd pin. tsr cannot be directly accessed by the cpu.
rev. 2.0, 09/02 page 295 of 658 13.3.5 serial mode register (smr) smr is used to set the sci?s serial transfer format and select the baud rate generator clock source. some bit functions of smr differ between normal serial communication interface mode and smart card interface mode. normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7c/ a 0 r/w communication mode 0: asynchronous mode 1: clocked synchronous mode 6 chr 0 r/w character length (enabled only in asynchronous mode) 0: selects 8 bits as the data length. 1: selects 7 bits as the data length. lsb-first is fixed and the msb (bit 7) of tdr is not transmitted in transmission. in clocked synchronous mode, a fixed data length of 8 bits is used. 5 pe 0 r/w parity enable (enabled only in asynchronous mode) when this bit is set to 1, the parity bit is added to transmit data before transmission, and the parity bit is checked in reception. for a multiprocessor format, parity bit addition and checking are not performed regardless of the pe bit setting. 4o/ e 0 r/w parity mode (enabled only when the pe bit is 1 in asynchronous mode) 0: selects even parity. when even parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is even. in reception, a check is performed to see if the total number of 1 bits in the receive character plus parity bit is even. 1: selects odd parity. when odd parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is odd. in reception, a check is performed to see if the total number of 1 bits in the receive character plus the parity bit is odd.
rev. 2.0, 09/02, page 296 of 658 bit bit name initial value r/w description 3 stop 0 r/w stop bit length (enabled only in asynchronous mode) selects the stop bit length in transmission. 0: 1 stop bit 1: 2 stop bits in reception, only the first stop bit is checked. if the second stop bit is 0, it is treated as the start bit of the next transmit character. 2 mp 0 r/w multiprocessor mode (enabled only in asynchronous mode) when this bit is set to 1, the multiprocessor communication function is enabled. the pe bit and o/ e bit settings are invalid in multiprocessor mode. for details, see 13.5, multiprocessor communication function. 1 0 cks1 cks0 0 0 r/w r/w clock select 0 and 1 these bits select the clock source for the baud rate generator. 00: clock (n = 0) 01: /4 clock (n = 1) 10: /16 clock (n = 2) 11: /64 clock (n = 3) for the relationship between the bit rate register setting and the baud rate, see section 13.3.9, bit rate register (brr). n is the decimal representation of the value of n in brr (see section 13.3.9, bit rate register (brr)).
rev. 2.0, 09/02 page 297 of 658 smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 gm 0 r/w gsm mode when this bit is set to 1, the sci operates in gsm mode. in gsm mode, the timing of the tend setting is advanced by 11.0 etu (elementary time unit: the time for transfer of one bit), and clock output control mode addition is performed. for details, refer to section 13.7.8, clock output control. 6 blk 0 r/w when this bit is set to 1, the sci operates in block transfer mode. for details on block transfer mode, refer to section 13.7.3, block transfer mode. 5 pe 0 r/w parity enable (enabled only in asynchronous mode) when this bit is set to 1, the parity bit is added to transmit data in transmission, and the parity bit is checked in reception. in smart card interface mode, this bit must be set to 1. 4o/ e 0 r/w parity mode (enabled only when the pe bit is 1 in asynchronous mode) 0: selects even parity. 1: selects odd parity. for details on setting this bit in smart card interface mode, refer to section 13.7.2, data format (except for block transfer mode). 3 2 bcp1 bcp0 0 0 r/w r/w basic clock pulse 0 and 1 these bits specify the number of basic clock periods in a 1-bit transfer interval on the smart card interface. 00: 32 clock (s = 32) 01: 64 clock (s = 64) 10: 372 clock (s = 372) 11: 256 clock (s = 256) for details, refer to section 13.7.4, receive data sampling timing and reception margin in smart card interface mode. s stands for the value of s in brr (see section 13.3.9, bit rate register (brr)).
rev. 2.0, 09/02, page 298 of 658 bit bit name initial value r/w description 1 0 cks1 cks0 0 0 r/w r/w clock select 0 and 1 these bits select the clock source for the baud rate generator. 00: clock (n = 0) 01: /4 clock (n = 1) 10: /16 clock (n = 2) 11: /64 clock (n = 3) for the relationship between the bit rate register setting and the baud rate, see section 13.3.9, bit rate register (brr). n is the decimal representation of the value of n in brr (see section 13.3.9, bit rate register (brr)). note: etu (elementary time unit): abbreviation for the transfer period for one bit. 13.3.6 serial control register (scr) scr is a register that enables or disables sci transfer operations and interrupt requests, and is also used to selection of the transfer clock source. for details on interrupt requests, refer to section 13.8, interrupts. some bit functions of scr differ between normal serial communication interface mode and smart card interface mode. normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when this bit is set to 1, the txi interrupt request is enabled. txi interrupt request cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0, or clearing the tie bit to 0. 6 rie 0 r/w receive interrupt enable when this bit is set to 1, rxi and eri interrupt requests are enabled. rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag in ssr, then clearing the flag to 0, or clearing the rie bit to 0.
rev. 2.0, 09/02 page 299 of 658 bit bit name initial value r/w description 5 te 0 r/w transmit enable when this bit s set to 1, transmission is enabled. in this state, serial transmission is started when transmit data is written to tdr and the tdre flag in ssr is cleared to 0. smr setting must be performed to decide the transfer format before setting the te bit to 1. when this bit is cleared to 0, the transmission operation is disabled, and the tdre flag is fixed at 1. 4 re 0 r/w receive enable when this bit is set to 1, reception is enabled. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in clocked synchronous mode. smr setting must be performed to decide the reception format before setting the re bit to 1. clearing the re bit to 0 does not affect the rdrf, fer,per, and orer flags, which retain their states. 3 mpie 0 r/w multiprocessor interrupt enable (enabled only when the mp bit in smr is 1 in asynchronous mode) when this bit is set to 1, receive data in which the multiprocessor bit is 0 is skipped, and setting of the rdrf, fer, and orer status flags in ssr is prohibited. on receiving data in which the multiprocessor bit is 1, this bit is automatically cleared and normal reception is resumed. for details, refer to section 13.5, multiprocessor communication function. when receive data including mpb = 0 is received, receive data transfer from rsr to rdr, receive error detection, and setting of the rerf, fer, and orer flags in ssr, are not performed. when receive data including mpb = 1 is received, the mpb bit in ssr is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrupts (when the tie and rie bits in scr are set to 1) and fer and orer flag setting are enabled.
rev. 2.0, 09/02, page 300 of 658 bit bit name initial value r/w description 2 teie 0 r/w transmit end interrupt enable this bit is set to 1, tei interrupt request is enabled. tei cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0. 1 0 cke1 cke0 0 0 r/w r/w clock enable 0 and 1 selects the clock source and sck pin function. asynchronous mode 00: on-chip baud rate generator sck pin functions as i/o port 01: on-chip baud rate generator outputs a clock of the same frequency as the bit rate from the sck pin. 1x: external clock inputs a clock with a frequency 16 times the bit rate from the sck pin. clocked synchronous mode 0x: internal clock (sck pin functions as clock output) 1x: external clock (sck pin functions as clock input) legend x: don?t care
rev. 2.0, 09/02 page 301 of 658 smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when this bit is set to 1, txi interrupt request is enabled. txi interrupt request cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0, or clearing the tie bit to 0. 6 rie 0 r/w receive interrupt enable when this bit is set to 1, rxi and eri interrupt requests are enabled. rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag in ssr, then clearing the flag to 0, or clearing the rie bit to 0. 5 te 0 r/w transmit enable when this bit s set to 1, transmission is enabled. in this state, serial transmission is started when transmit data is written to tdr and the tdre flag in ssr is cleared to 0. smr setting must be performed to decide the transfer format before setting the te bit to 1. when this bit is cleared to 0, the transmission operation is disabled, and the tdre flag is fixed at 1. 4 re 0 r/w receive enable when this bit is set to 1, reception is enabled. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in clocked synchronous mode. smr setting must be performed to decide the reception format before setting the re bit to 1. clearing the re bit to 0 does not affect the rdrf, fer,per, and orer flags, which retain their states.
rev. 2.0, 09/02, page 302 of 658 bit bit name initial value r/w description 3 mpie 0 r/w multiprocessor interrupt enable (enabled only when the mp bit in smr is 1 in asynchronous mode) write 0 to this bit in smart card interface mode. when receive data including mpb = 0 is received, receive data transfer from rsr to rdr, receive error detection, and setting of the rerf, fer, and orer flags in ssr, are not performed. when receive data including mpb = 1 is received, the mpb bit in ssr is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrupts (when the tie and rie bits in scr are set to 1) and fer and orer flag setting are enabled. 2 teie 0 r/w transmit end interrupt enable write 0 to this bit in smart card interface mode. tei cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0. 1 0 cke1 cke0 0 0 r/w clock enable 0 and 1 enables or disables clock output from the sck pin. the clock output can be dynamically switched in gsm mode. for details, refer to section 13.7.8, clock output control. when the gm bit in smr is 0: 00: output disabled (sck pin can be used as an i/o port pin) 01: clock output 1x: reserved when the gm bit in smr is 1: 00: output fixed low 01: clock output 10: output fixed high 11: clock output legend x: don?t care
rev. 2.0, 09/02 page 303 of 658 13.3.7 serial status register (ssr) ssr is a register containing status flags of the sci and multiprocessor bits for transfer. 1 cannot be written to flags tdre, rdrf, orer, per, and fer; they can only be cleared. some bit functions of ssr differ between normal serial communication interface mode and smart card interface mode. normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7 tdre 1 r/(w) * transmit data register empty displays whether tdr contains transmit data. [setting conditions] ? when the te bit in scr is 0 ? when data is transferred from tdr to tsr and data can be written to tdr [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dtc is activated by a txi interrupt request and writes data to tdr (h8s/2268 series only) 6 rdrf 0 r/(w) * receive data register full indicates that the received data is stored in rdr. [setting condition] ? when serial reception ends normally and receive data is transferred from rsr to rdr [clearing conditions] ? when 0 is written to rdrf after reading rdrf = 1 ? when the dtc is activated by an rxi interrupt and transferred data from rdr (h8s/2268 series only) the rdrf flag is not affected and retains their previous values when the re bit in scr is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost.
rev. 2.0, 09/02, page 304 of 658 bit bit name initial value r/w description 5 orer 0 r/(w) * overrun error indicates that an overrun error occurred during reception, causing abnormal termination. [setting condition] ? when the next serial reception is completed while rdrf = 1 the receive data prior to the overrun error is retained in rdr, and the data received subsequently is lost. also, subsequent serial reception cannot be continued while the orer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued either. [clearing condition] ? when 0 is written to orer after reading orer = 1 the orer flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 4fer 0 r/(w) * framing error indicates that a framing error occurred during reception in asynchronous mode, causing abnormal termination. [setting condition] ? when the stop bit is 0 in 2 stop bit mode, only the first stop bit is checked for a value to 1; the second stop bit is not checked. if a framing error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the fer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] ? when 0 is written to fer after reading fer = 1 in 2-stop-bit mode, only the first stop bit is checked. the fer flag is not affected and retains its previous state when the re bit in scr is cleared to 0.
rev. 2.0, 09/02 page 305 of 658 bit bit name initial value r/w description 3 per 0 r/(w) * parity error indicates that a parity error occurred during reception using parity addition in asynchronous mode, causing abnormal termination. [setting condition.] ? when a parity error is detected during reception if a parity error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] ? when 0 is written to per after reading per = 1 the per flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 2 tend 1 r transmit end indicates that transmission has been ended. [setting conditions] ? when the te bit in scr is 0 ? when tdre = 1 at transmission of the last bit of a 1-byte serial transmit character [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dtc is activated by a txi interrupt request and transfer transmission data to tdr (h8s/2268 series only) 1 mpb 0 r multiprocessor bit mpb stores the multiprocessor bit in the receive data. when the re bit in scr is cleared to 0 its previous state is retained. 0 mpbt 0 r/w multiprocessor bit transfer mpbt stores the multiprocessor bit to be added to the transmit data. note: * only a 0 can be written to this bit, to clear the flag.
rev. 2.0, 09/02, page 306 of 658 smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 tdre 1 r/(w) * transmit data register empty indicates whether tdr contains transmit data. [setting conditions] ? when the te bit in scr is 0 ? when data is transferred from tdr to tsr and data can be written to tdr [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dtc is activated by a txi interrupt request and writes data to tdr (h8s/2268 series only) 6 rdrf 0 r/(w) * receive data register full indicates that the received data is stored in rdr. [setting condition] ? when serial reception ends normally and receive data is transferred from rsr to rdr [clearing conditions] ? when 0 is written to rdrf after reading rdrf = 1 ? when the dtc is activated by an rxi interrupt and transferred data from rdr (h8s/2268 series only) the rdrf flag is not affected and retains their previous values when the re bit in scr is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost.
rev. 2.0, 09/02 page 307 of 658 bit bit name initial value r/w description 5 orer 0 r/(w) * overrun error indicates that an overrun error occurred during reception, causing abnormal termination. [setting condition] ? when the next serial reception is completed while rdrf = 1 the receive data prior to the overrun error is retained in rdr, and the data received subsequently is lost. also, subsequent serial cannot be continued while the orer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] ? when 0 is written to orer after reading orer = 1 the orer flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 4ers 0 r/(w) * error signal status indicates that the status of an error, signal 1 returned from the reception side at reception [setting condition] ? when the low level of the error signal is sampled [clearing conditions] ? when 0 is written to ers after reading ers = 1 the ers flag is not affected and retains its previous state when the re bit in scr is cleared to 0.
rev. 2.0, 09/02, page 308 of 658 bit bit name initial value r/w description 3 per 0 r/(w) * parity error indicates that a parity error occurred during reception using parity addition in asynchronous mode, causing abnormal termination. [setting condition] ? when a parity error is detected during reception if a parity error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] ? when 0 is written to per after reading per = 1 the per flag is not affected and retains its previous state when the re bit in scr is cleared to 0.
rev. 2.0, 09/02 page 309 of 658 bit bit name initial value r/w description 2 tend 1 r transmit end this bit is set to 1 when no error signal has been sent back from the receiving end and the next transmit data is ready to be transferred to tdr. [setting conditions] ? when the te bit in scr is 0 and the ers bit is also 0 when the esr bit is 0 and the tdre bit is 1 after the specified interval following transmission of 1- byte data. the timing of bit setting differs according to the register setting as follows: when gm = 0 and blk = 0, 2.5 etu after transmission starts when gm = 0 and blk = 1, 1.0 etu after transmission starts when gm = 1 and blk = 0, 1.5 etu after transmission starts when gm = 1 and blk = 1, 1.0 etu after transmission starts [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dtc is activated by a txi interrupt and transfers transmission data to tdr (h8s/2268 series only) 1 mpb 0 r multiprocessor bit this bit is not used in smart card interface mode. 0 mpbt 0 r/w multiprocessor bit transfer write 0 to this bit in smart card interface mode. note: only 0 can be written to this bit, to clear the flag.
rev. 2.0, 09/02, page 310 of 658 13.3.8 smart card mode register (scmr) scmr is a register that selects smart card interface mode and its format. bit bit name initial value r/w description 7 to 4 ? all 1 ? reserved these bits are always read as 1, and cannot be modified. 3 sdir 0 r/w smart card data transfer direction selects the serial/parallel conversion format. 0: lsb-first in transfer 1: msb-first in transfer the bit setting is valid only when the transfer data format is 8 bits. for 7-bit data, lsb-first is fixed. 2 sinv 0 r/w smart card data invert specifies inversion of the data logic level. the sinv bit does not affect the logic level of the parity bit. to invert the parity bit, invert the o/ e bit in smr. 0: tdr contents are transmitted as they are. receive data is stored as it is in rdr 1: tdr contents are inverted before being transmitted. receive data is stored in inverted form in rdr 1? 1 ? reserved this bit is always read as 1, and cannot be modified. 0 smif 0 r/w smart card interface mode select this bit is set to 1 to make the sci operate in smart card interface mode. 0: normal asynchronous mode or clocked synchronous mode 1: smart card interface mode
rev. 2.0, 09/02 page 311 of 658 13.3.9 bit rate register (brr) brr is an 8-bit register that adjusts the bit rate. as the sci performs baud rate generator control independently for each channel, different bit rates can be set for each channel. table 13.2 shows the relationships between the n setting in brr and bit rate b for normal asynchronous mode, clocked synchronous mode, and smart card interface mode. the initial value of brr is h'ff, and it can be read or written to by the cpu at all times. table 13.2 the relationships between the n setting in brr and bit rate b communication mode abcs bit bit rate error 0 b = 64 2 2n-1 (n + 1) 10 6 error (%) = { b 64 2 2n-1 (n + 1) -1 } 100 10 6 asynchronous mode 1 b = 32 2 2n-1 (n + 1) 10 6 error (%) = { b 32 2 2n-1 (n + 1) -1 } 100 10 6 clocked synchronous mode ? b = 8 2 2n-1 (n + 1) 10 6 ? smart card interface mode ? b = s 2 2n+1 (n + 1) 10 6 error (%) = { b s 2 2n+1 (n + 1) -1 } 100 10 6 note: b: bit rate (bit/s) n: brr setting for baud rate generator (0 n 255) : operating frequency (mhz) n and s: determined by the smr settings shown in the following tables. smr setting smr setting cks1 cks0 clock source n bcp1 bcp0 s 00 00032 01 /4 1 0 1 64 10 /16 2 1 0 372 11 /64 3 1 1 256
rev. 2.0, 09/02, page 312 of 658 table 13.3 shows sample n settings in brr in normal asynchronous mode. table 13.4 shows the maximum bit rate for each frequency in normal asynchronous mode. table 13.6 shows sample n settings in brr in clocked synchronous mode. table 13.8 shows sample n settings in brr in smart card interface mode. in smart card interface mode, s (the number of basic clock periods in a 1-bit transfer interval) can be selected. for details, refer to section 13.7.4, receive data sampling timing and reception margin. tables 13.5 and 13.7 show the maximum bit rates with external clock input. when the abcs bit in semr_0 of sci_0 is set to 1 in asynchronous mode, the maximum bit rate is twice the value shown in tables 13.4 and 13.5. table 13.3 brr settings for various bit rates (asynchronous mode) (1) operating frequency (mhz) 2 2.097152 2.4576 3 bit rate (bps) n n error (%) n n error (%) n n error (%) n n error (%) 110 1 141 0.03 1 148 ?0.04 1 174 ?0.26 1 212 0.33 150 1 103 0.16 1 108 0.21 1 127 0.00 1 155 0.16 300 0 207 0.16 0 217 0.21 0 255 0.00 1 77 0.16 600 0 103 0.16 0 108 0.21 0 127 0.00 0 155 0.16 1200 0 51 0.16 0 54 ?0.70 0 63 0.00 0 77 0.16 2400 0 25 0.16 0 26 1.14 0 31 0.00 0 38 0.16 4800 0 12 0.16 0 13 ?2.48 0 15 0.00 0 19 ?2.34 9600 ? ? ? 0 6 ?2.48 0 7 0.00 0 9 ?2.34 19200 ? ? ? ? ? ? 0 3 0.00 0 4 ?2.34 31250 0 1 0.00 ? ? ? ? ? ? 0 2 0.00 38400 ? ? ? ? ? ? 0 1 0.00 ? ? ?
rev. 2.0, 09/02 page 313 of 658 table 13.3 brr settings for various bit rates (asynchronous mode) (2) operating frequency (mhz) 3.6864 4 4.9152 5 bit rate (bps) nn error (%) n n error (%) n n error (%) n n error (%) 110 2 64 0.70 2 70 0.33 2 86 0.31 2 88 ?0.25 150 1 191 0.00 1 207 0.16 2 255 0.00 2 64 0.16 300 1 95 0.00 1 103 0.16 1 127 0.00 1 129 0.16 600 0 191 0.00 0 207 0.16 1 255 0.00 1 64 0.16 1200 0 95 0.00 0 103 0.16 0 127 0.00 0 129 0.16 2400 0 47 0.00 0 51 0.16 0 63 0.00 0 64 0.16 4800 0 23 0.00 0 25 0.16 0 31 0.00 0 32 ?1.36 9600 0 11 0.00 0 12 0.16 0 15 0.00 0 15 1.73 19200 0 5 0.00 ? ? ? 0 7 0.00 0 7 1.73 31250 ? ? ? 0 3 0.00 0 4 ?1.70 0 4 0.00 38400 0 2 0.00 ? ? ? 0 3 0.00 0 3 1.73 operating frequency (mhz) 6 6.144 7.3728 8 bit rate (bps) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 106 ?0.44 2 108 0.08 2 130 ?0.07 2 141 0.03 150 2 77 0.16 2 79 0.00 2 95 0.00 2 103 0.16 300 1 155 0.16 1 159 0.00 1 191 0.00 1 207 0.16 600 1 77 0.16 1 79 0.00 1 95 0.00 1 103 0.16 1200 0 155 0.16 0 159 0.00 0 191 0.00 0 207 0.16 2400 0 77 0.16 0 79 0.00 0 95 0.00 0 103 0.16 4800 0 38 0.16 0 39 0.00 0 47 0.00 0 51 0.16 9600 0 19 ?2.34 0 19 0.00 0 23 0.00 0 25 0.16 19200 0 9 ?2.34 0 9 0.00 0 11 0.00 0 12 0.16 31250 0 5 0.00 0 5 2.40 ? ? ? 0 7 0.00 38400 0 4 ?2.34 0 4 0.00 0 5 0.00 ? ? ?
rev. 2.0, 09/02, page 314 of 658 table 13.3 brr settings for various bit rates (asynchronous mode) (3) operating frequency (mhz) 9.8304 10 12 12.288 bit rate (bps) nn error (%) n n error (%) n n error (%) n n error (%) 110 2 174 ?0.26 2 177 ?0.25 2 212 0.03 2 217 0.08 150 2 127 0.00 2 129 0.16 2 155 0.16 2 159 0.00 300 1 255 0.00 2 64 0.16 2 77 0.16 2 79 0.00 600 1 127 0.00 1 129 0.16 1 155 0.16 1 159 0.00 1200 0 255 0.00 1 64 0.16 1 77 0.16 1 79 0.00 2400 0 127 0.00 0 129 0.16 0 155 0.16 0 159 0.00 4800 0 63 0.00 0 64 0.16 0 77 0.16 0 79 0.00 9600 0 31 0.00 0 32 ?1.36 0 38 0.16 0 39 0.00 19200 0 15 0.00 0 15 1.73 0 19 ?2.34 0 19 0.00 31250 0 9 ?1.70 0 9 0.00 0 11 0.00 0 11 2.40 38400 0 7 0.00 0 7 1.73 0 9 ?2.34 0 9 0.00 operating frequency (mhz) 14 14.7456 16 17.2032 bit rate (bps) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 248 ?0.17 3 64 0.70 3 70 0.03 3 75 0.48 150 2 181 0.16 2 191 0.00 2 207 0.16 2 223 0.00 300 2 90 0.16 2 95 0.00 2 103 0.16 2 111 0.00 600 1 181 0.16 1 191 0.00 1 207 0.16 1 223 0.00 1200 1 90 0.16 1 95 0.00 1 103 0.16 1 111 0.00 2400 0 181 0.16 0 191 0.00 0 207 0.16 0 223 0.00 4800 0 90 0.16 0 95 0.00 0 103 0.16 0 111 0.00 9600 0 45 ?0.93 0 47 0.00 0 51 0.16 0 55 0.00 19200 0 22 ?0.93 0 23 0.00 0 25 0.16 0 27 0.00 31250 0 13 0.00 0 14 ?1.70 0 15 0.00 0 16 1.20 38400 ? ? ? ? 11 0.00 0 12 0.16 0 13 0.00
rev. 2.0, 09/02 page 315 of 658 table 13.3 brr settings for various bit rates (asynchronous mode) (4) operating frequency (mhz) 18 19.6608 20 bit rate (bps) nn error (%) n n error (%) n n error (%) 110 3 79 ?0.12 3 86 0.31 3 88 ?0.25 150 2 233 0.16 2 255 0.00 2 64 0.16 300 2 116 0.16 2 127 0.00 2 129 0.16 600 1 233 0.16 1 255 0.00 1 64 0.16 1200 1 116 0.16 1 127 0.00 1 129 0.16 2400 0 233 0.16 0 255 0.00 0 64 0.16 4800 0 116 0.16 0 127 0.00 0 129 0.16 9600 0 58 ?0.69 0 63 0.00 0 64 0.16 19200 0 28 1.02 0 31 0.00 0 32 ?1.36 31250 0 17 0.00 0 19 ?1.70 0 19 0.00 38400 0 14 ?2.34 0 15 0.00 0 15 1.73 table 13.4 maximum bit rate for each frequency (asynchronous mode) (mhz) maximum bit rate (kbps) nn (mhz) maximum bit rate (kbps) nn 2 62.5 0 0 9.8304 307.2 0 0 2.097152 65.536 0 0 10 312.5 0 0 2.4576 76.8 0 0 12 375.0 0 0 3 93.75 0 0 12.288 384.0 0 0 3.6864 115.2 0 0 14 437.5 0 0 4 125.0 0 0 14.7456 460.8 0 0 4.9152 153.6 0 0 16 500.0 0 0 5 156.25 0 0 17.2032 537.6 0 0 6 187.5 0 0 18 562.5 0 0 6.144 192.0 0 0 19.6608 614.4 0 0 7.3728 230.4 0 0 20 625.0 0 0 8 250.0 0 0
rev. 2.0, 09/02, page 316 of 658 table 13.5 maximum bit rate with external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (kbps) (mhz) external input clock (mhz) maximum bit rate (kbps) 2 0.5000 31.25 9.8304 2.4576 153.6 2.097152 0.5243 327.68 10 2.5000 156.25 2.4576 0.6144 38.4 12 3.0000 187.5 3 0.7500 46.875 12.288 3.0720 192.0 3.6864 0.9216 57.6 14 3.5000 218.75 4 1.0000 62.5 14.7456 3.6864 230.4 4.9152 1.2288 76.8 16 4.0000 250.0 5 1.2500 78.125 17.2032 4.3008 268.8 6 1.5000 93.75 18 4.5000 281.25 6.144 1.5360 96.0 19.6608 4.9152 307.2 7.3728 1.8432 115.2 20 5.0000 312.5 8 2.0000 125.0
rev. 2.0, 09/02 page 317 of 658 table 13.6 brr settings for various bit rates (clocked synchronous mode) operating frequency (mhz) 2 4 8 10 16 20 bit rate (bps) nn nn nn nn nn nn 110 3 70 ? ? 250 2 124 2 249 3 124 ? ? 3 249 500 1 249 2 124 2 249 ? ? 3 124 ? ? 1k 1 124 1 249 2 124 ? ? 2 249 ? ? 2.5k 0 199 1 99 1 199 1 249 2 99 2 124 5k 0 99 0 199 1 99 1 124 1 199 1 249 10k 0 49 0 99 0 199 0 249 1 99 1 124 25k 0 19 0 39 0 79 0 99 0 159 0 199 50k 0 9 0 19 0 39 0 49 0 79 0 99 100k 0 4 0 9 0 19 0 24 0 39 0 49 250k 0 1 0 3 0 7 0 9 0 15 0 19 500k 0 0 * 01 03 04 07 09 1m 0 0 * 01 03 04 2.5m 0 0 * 01 5m 00 * legend blank : cannot be set. ? : can be set, but there will be a degree of error. * : continuous transfer is not possible. table 13.7 maximum bit rate with external clock input (clocked synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bps) (mhz) external input clock (mhz) maximum bit rate (bps) 2 0.3333 0.333 12 2.0000 2.000 4 0.6667 0.667 14 2.6667 2.667 6 1.0000 1.000 16 3.0000 3.000 8 1.3333 1.333 20 3.3333 3.333 10 1.6667 1.667
rev. 2.0, 09/02, page 318 of 658 table 13.8 examples of bit rate for various brr settings (smart card interface mode) (when n = 0 and s = 372) operating frequency (mhz) 5.00 7.00 7.1424 10.00 10.7136 bit rate (bps) n error (%) n error (%) n error (%) n error (%) n error (%) 6720 0 0.00 1 30 1 28.75 1 0.01 1 7.14 9600 0.00 1 30 1 25 operating frequency (mhz) 13.00 14.2848 16.00 18.00 20.00 bit rate (bps) n error (%) n error (%) n error (%) n error (%) n error (%) 6720 2 13.33 2 4.76 2 6.67 2 20.01 2 33.34 9600 1 8.99 1 0.00 1 12.01 2 15.99 2 6.66 table 13.9 maximum bit rate at various frequencies (smart card interface mode) (when s = 372) (mhz) maximum bit rate (bps) n n 5.00 6720 0 0 7.00 9409 0 0 7.1424 9600 0 0 10.00 13441 0 0 10.7136 14400 0 0 13.00 17473 0 0 14.2848 19200 0 0 16.00 21505 0 0 18.00 24194 0 0 20.00 26882 0 0
rev. 2.0, 09/02 page 319 of 658 13.3.10 serial expansion mode register (semr_0) semr_0 is an 8-bit register that expands sci_0 functions; such as setting of the basic clock, selecting of the clock source, and automatic setting of the transfer rate. bit bit name initial value r/w description 7? 0 r/wreserved this is a readable/writable bit, but the write value should always be 0. 6 to 4 ? all 0 ? reserved the write value should always be 0. 3 abcs 0 r/w asynchronous basic clock select selects the 1-bit-interval base clock in asynchronous mode. the abcs setting is valid in asynchronous mode (c/ a in smr = 0). 0: operates on a basic clock with a frequency of 16-times the transfer rate. 1: operates on a basic clock with a frequency of 8- times the transfer rate.
rev. 2.0, 09/02, page 320 of 658 bit bit name initial value r/w description 2 1 0 acs2 acs1 acs0 0 0 0 r/w r/w r/w asynchronous clock source select when an average transfer rate is selected, the base clock is set automatically regardless of the abcs value. note that average transfer rates are not supported for operating frequencies other than 10.667 mhz and 16 mhz. the acs0 to acs0 settings are valid when the external clock input is selected (cke1 in scr = 1) in asynchronous mode (c/ a in smr = 0). 000: external clock input 001: selects the average transfer rate 115.152 kbps only for = 10.667mhz (operates on a basic clock with a frequency of 16-times the transfer rate). 001: selects the average transfer rate 460.606 kbps only for = 10.667mhz (operates on a basic clock with a frequency of 8-times the transfer rate). 011: reserved 100: tpu clock input (logical ands tioca1 and tioca2) 101: 115.196 kbps average transfer rate (for = 6 mhz only) is selected (sci0 operates on base clock with frequency of 16 times transfer rate) 110: 460.784 kbps average transfer rate (for = 6 mhz only) is selected (sci0 operates on base clock with frequency of 16 times transfer rate) 111: 720 kbps average transfer rate (for = 6 mhz only) is selected (sci0 operates on base clock with frequency of 8 times transfer rate) figure 13.3 and 13.4 shows an example of the internal base clock when the average transfer rate is selected.
rev. 2.0, 09/02 page 321 of 658 1234567891011 123 45 67 8 12 13 14 15 16 17 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 1 2 3 4 28 29 5.333 mhz 3.6848 mhz 123 123 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 22 4 5 6 7 8 9 10 11 12 13 14 15 16 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 1 2 3 4 28 29 2.667 mhz 1.8424 mhz 1 bit = base clock x 16 * base clock 10.667 mhz/4 = 2.667 mhz 2.667 mhz x (38/55) = 1.8424 mhz (average) average transfer rate when = 10.667 mhz average transfer rate = 1.8424 mhz/16 = 115.152 kbps average error with 115.2kbps = - 0.043% 1 bit = base clock x 16 * base clock 10.667 mhz/2 = 5.333 mhz 5.333 mhz x (38/55) = 3.6848 mhz (average) average transfer rate when = 460.606 mhz average transfer rate = 3.6848 mhz/8 = 460.606 kbps average error with 460.6kbps = - 0.043% note: the 1-bit length changes according to the base clock synchronization. figure 13.3 example of the internal base clock when the average transfer rate is selected (1)
rev. 2.0, 09/02, page 322 of 658 12345678910 123 45 678 11 12 13 14 15 16 17 18 19 20 21 23 22 24 25 1 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 34 8 mhz 7.3725 mhz 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 28 29 8 mhz 5.76 mhz 123 2 mhz 1.8431 mhz 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 1 2 3 4 5 6 7 8 28 29 1 bit = base clock x 16* base clock 16 mhz/8 = 2 mhz 2 mhz x (47/51) = 1.8431 mhz (average) average transfer rate when f = 115.196 kbps average transfer rate = 1.8431 mhz/16 = 115.196 kbps average error with 115.2kbps = - 0.004% 1 bit = base clock x 16 * base clock 16 mhz/2 = 8 mhz 8 mhz x (47/51) = 7.3725 mhz (average) average transfer rate when = 460.784 kbps average transfer rate = 7.3725 mhz/16 = 460.784 kbps average error with 460.8kbps = - 0.004% 1 bit = base clock x 16 * base clock 16 mhz/2 = 8 mhz 8 mhz x (18/5) = 5.76 mhz (average) average transfer rate when = 720 kbps average transfer rate = 5.76 mhz/8 = 720 kbps average error with 720kbps = - 0% note: the 1-bit length changes according to the base clock synchronization. figure 13.4 example of the internal base clock when the average transfer rate is selected (2)
rev. 2.0, 09/02 page 323 of 658 13.4 operation in asynchronous mode figure 13.5 shows the general format for asynchronous serial communication. one frame consists of a start bit (low level), followed by data, a parity bit, and finally stop bits (high level). in asynchronous serial communication, the transmission line is usually held in the mark state (high level). the sci monitors the transmission line, and when it goes to the space state (low level), recognizes a start bit and starts serial communication. inside the sci, the transmitter and receiver are independent units, enabling full-duplex communication. both the transmitter and the receiver also have a double-buffered structure, so that data can be read or written during transmission or reception, enabling continuous data transfer. in asynchronous mode, the sci performs synchronization at the falling edge of the start bit in reception. the sci samples the data on the 8th pulse of a clock with a frequency of 16 times the length of one bit, so that the transfer data is latched at the center of each bit. the sci_0 samples the data on the 4th pulse of a clock with a frequency of 8 times the length of one bit when the abcs bit in semr_0 is 1. lsb start bit msb idle state (mark state) stop bit 0 transmit/receive data d0 d1 d2 d3 d4 d5 d6 d7 0/1 1 1 1 1 serial data parity bit 1 bit 1 or 2 bits 7 or 8 bits 1 bit, or none one unit of transfer data (character or frame) figure 13.5 data format in asynchronous communication (example with 8-bit data, parity, two stop bits) 13.4.1 data transfer format table 13.10 shows the data transfer formats that can be used in asynchronous mode. any of 12 transfer formats can be selected according to the smr setting. for details on the multiprocessor bit, refer to section 13.5, multiprocessor communication function.
rev. 2.0, 09/02, page 324 of 658 table 13.10 serial transfer formats (asynchronous mode) pe 0 0 1 1 0 0 1 1 ? ? ? ? s 8-bit data stop s 7-bit data stop s 8-bit data stopstop s 8-bit data p stop s 7-bit data stop p s 8-bit data mpb stop s 8-bit data mpb stopstop s 7-bit data stop mpb s 7-bit data stop mpb stop s 7-bit data stop stop chr 0 0 0 0 1 1 1 1 0 0 1 1 mp 0 0 0 0 0 0 0 0 1 1 1 1 stop 0 1 0 1 0 1 0 1 0 1 0 1 smr settings 123456789101112 serial transfer format and frame length stop s 8-bit data p stop s 7-bit data stop p stop legend s : start bit stop : stop bit p: parity bit mpb : multiprocessor bit
rev. 2.0, 09/02 page 325 of 658 13.4.2 receive data sampling timing and reception margin in asynchronous mode in asynchronous mode, the sci operates on a basic clock with a frequency of 16 times the transfer rate. in reception, the sci samples the falling edge of the start bit using the basic clock, and performs internal synchronization. receive data is latched internally at the rising edge of the 8th pulse of the basic clock as shown in figure 13.6. thus, the reception margin in asynchronous mode is given by formula (1) below. m = { (0.5 ? ) ? ? (l ? 0.5) f} 100 [%] 1 2n d ? 0.5 n ... formula (1) where n : ratio of bit rate to clock (n = 16) d : clock duty (d = 0.5 to 1.0) l : frame length (l = 9 to 12) f : absolute value of clock rate deviation assuming values of f (absolute value of clock rate deviation) = 0, d (clock duty) = 0.5, and n (ratio of bit rate to clock) = 16 in formula (1), the reception margin can be given by the formula. m = {0.5 ? 1/(2 16)} 100 [%] = 46.875% however, this is only the computed value, and a margin of 20% to 30% should be allowed for in system design. internal basic clock 16 clocks 8 clocks receive data (rxd) synchronization sampling timing start bit d0 d1 data sampling timing 15 0 7 15 0 07 figure 13.6 receive data sampling timing in asynchronous mode
rev. 2.0, 09/02, page 326 of 658 13.4.3 clock either an internal clock generated by the on-chip baud rate generator or an external clock input at the sck pin can be selected as the sci?s serial clock, according to the setting of the c/ a bit in smr and the cke0 and cke1 bits in scr. when an external clock is input at the sck pin, the clock frequency should be 16 times the bit rate used. when an external clock is selected, a base clock with an average transfer rate can be selected by setting bits acs2 to acs0 in semr_0. when the sci is operated on an internal clock, the clock can be output from the sck pin when setting cke1 = 0 and cke0 = 1. the frequency of the clock output in this case is equal to the bit rate, and the phase is such that the rising edge of the clock is in the middle of the transmit data, as shown in figure 13.7. 0 1 frame d0 d1 d2 d3 d4 d5 d6 d7 0/1 11 sck txd figure 13.7 relationship between output clock and transfer data phase (asynchronous mode) 13.4.4 sci initialization (asynchronous mode) before transmitting and receiving data, you should first clear the te and re bits in scr to 0, then initialize the sci as described below. when the operating mode, or transfer format, is changed for example, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1. note that clearing the re bit to 0 does not initialize the contents of the rdrf, per, fer, and orer flags, or the contents of rdr. when the external clock is used in asynchronous mode, the clock must be supplied even during initialization.
rev. 2.0, 09/02 page 327 of 658 wait start initialization set data transfer format in smr, scmr, and semr_0 [1] set cke1 and cke0 bits in scr (te, re bits 0) no yes set value in brr clear te and re bits in scr to 0 [2] [3] set te and re bits in scr to 1, and set rie, tie, teie, and mpie bits [4] 1-bit interval elapsed? [1] set the clock selection in scr. be sure to clear bits rie, tie, teie, and mpie, and bits te and re, to 0. when the clock is selected in asynchronous mode, it is output immediately after scr settings are made. [2] set the data transfer format in smr, scmr and semr_0. [3] write a value corresponding to the bit rate to brr. not necessary if an external clock or an average transfer rate clock by bits ac2 to acs0 in semr_0 is used. [4] wait at least one bit interval, then set the te bit or re bit in scr to 1. also set the rie, tie, teie, and mpie bits. figure 13.8 sample sci initialization flowchart 13.4.5 serial data transmission (asynchronous mode) figure 13.9 shows an example of operation for transmission in asynchronous mode. in transmission, the sci operates as described below. 1. the sci monitors the tdre flag in ssr. if the flag is cleared to 0, the sci recognizes that data has been written to tdr, and transfers the data from tdr to tsr. 2. after transferring data from tdr to tsr, the sci sets the tdre flag to 1 and starts transmission. if the tie bit is set to 1 at this time, a transmit data empty interrupt request (txi) is generated. continuous transmission is possible because the txi interrupt routine writes next transmit data to tdr before transmission of the current transmit data has been completed. 3. data is sent from the txd pin in the following order: start bit, transmit data, parity bit or multiprocessor bit (may be omitted depending on the format), and stop bit. 4. the sci checks the tdre flag at the timing for sending the stop bit. 5. if the tdre flag is 0, the data is transferred from tdr to tsr, the stop bit is sent, and then serial transmission of the next frame is started.
rev. 2.0, 09/02, page 328 of 658 6. if the tdre flag is 1, the tend flag in ssr is set to 1, the stop bit is sent, and then the ?mark state? is entered, in which 1 is output. if the teie bit in scr is set to 1 at this time, a tei interrupt request is generated. tdre tend 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 1 1 1 data start bit parity bit stop bit start bit data parity bit stop bit txi interrupt request generated data written to tdr and tdre flag cleared to 0 in txi interrupt service routine tei interrupt request generated idle state (mark state) txi interrupt request generated figure 13.9 example of operation in transmission in asynchronous mode (example with 8-bit data, parity, one stop bit)
rev. 2.0, 09/02 page 329 of 658 figure 13.10 shows a sample flowchart for data transmission. no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and clear tdre flag in ssr to 0 no yes no yes read tend flag in ssr [3] no yes [4] clear dr to 0 and set ddr to 1 clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 break output? [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. after the te bit is set to 1, a frame of 1s is output, and transmission is enabled. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dtc is activated by a transmit data empty interrupt (txi) request, and data is written to tdr. (h8s/2268 series only) [4] break output at the end of serial transmission: to output a break in serial transmission, set dr for the port corresponding to the txd pin to 0, clear ddr to 1, then clear the te figure 13.10 sample serial transmission flowchart
rev. 2.0, 09/02, page 330 of 658 13.4.6 serial data reception (asynchronous mode) figure 13.11 shows an example of operation for reception in asynchronous mode. in serial reception, the sci operates as described below. 1. the sci monitors the communication line. if a start bit is detected, the sci performs internal synchronization, receives receive data in rsr, and checks the parity bit and stop bit. 2. if an overrun error occurs (when reception of the next data is completed while the rdrf flag is still set to 1), the orer bit in ssr is set to 1. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. receive data is not transferred to rdr. the rdrf flag remains to be set to 1. 3. if a parity error is detected, the per bit in ssr is set to 1 and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. 4. if a framing error is detected (when the stop bit is 0), the fer bit in ssr is set to 1 and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. 5. if reception is completed successfully, the rdrf bit in ssr is set to 1, and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an rxi interrupt request is generated. continuous reception is possible because the rxi interrupt routine reads the receive data transferred to rdr before reception of the next receive data has been completed. rdrf fer 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 0 1 1 data start bit parity bit stop bit start bit data parity bit stop bit eri interrupt request generated by framing error idle state (mark state) rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine rxi interrupt request generated figure 13.11 example of sci operation in reception (example with 8-bit data, parity, one stop bit)
rev. 2.0, 09/02 page 331 of 658 table 13.11 shows the states of the ssr status flags and receive data handling when a receive error is detected. if a receive error is detected, the rdrf flag retains its state before receiving data. reception cannot be resumed while a receive error flag is set to 1. accordingly, clear the orer, fer, per, and rdrf bits to 0 before resuming reception. figure 13.12 shows a sample flow chart for serial data reception. table 13.11 ssr status flags and receive data handling ssr status flag rdrf * orer fer per receive data receive error type 1100lost overrun error 0010transferred to rdrframing error 0001transferred to rdrparity error 1110lost overrun error + framing error 1101lost overrun error + parity error 0011transferred to rdrframing error + parity error 1111lost overrun error + framing error + parity error note: * the rdrf flag retains the state it had before data reception.
rev. 2.0, 09/02, page 332 of 658 yes [1] no initialization start reception [2] no yes read rdrf flag in ssr [4] [5] clear re bit in scr to 0 read orer, per, and fer flags in ssr error processing (continued on next page) [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes per fer orer = 1 rdrf = 1 all data received? [1] sci initialization: the rxd pin is automatically designated as the receive data input pin. [2] [3] receive error processing and break detection: if a receive error occurs, read the orer, per, and fer flags in ssr to identify the error. after performing the appropriate error processing, ensure that the orer, per, and fer flags are all cleared to 0. reception cannot be resumed if any of these flags are set to 1. in the case of a framing error, a break can be detected by reading the value of the input port corresponding to the rxd pin. [4] sci status check and receive data read: read ssr and check that rdrf = 1, then read the receive data in rdr and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. [5] serial reception continuation procedure: to continue serial reception, before the stop bit for the current frame is received, read the rdrf flag, read rdr, and clear the rdrf flag to 0. the rdrf flag is cleared automatically when dtc is activated by an rxi interrupt and the rdr value is read. (h8s/2268 series only) figure 13.12 sample serial reception data flowchart (1)
rev. 2.0, 09/02 page 333 of 658 [3] error processing parity error processing yes no clear orer, per, and fer flags in ssr to 0 no yes no yes framing error processing no yes overrun error processing orer = 1 fer = 1 break? per = 1 clear re bit in scr to 0 figure 13.12 sample serial reception data flowchart (2)
rev. 2.0, 09/02, page 334 of 658 13.5 multiprocessor communication function use of the multiprocessor communication function enables data transfer between a number of processors sharing communication lines by asynchronous serial communication using the multiprocessor format, in which a multiprocessor bit is added to the transfer data. when multiprocessor communication is performed, each receiving station is addressed by a unique id code. the serial communication cycle consists of two component cycles; an id transmission cycle that specifies the receiving station, and a data transmission cycle. the multiprocessor bit is used to differentiate between the id transmission cycle and the data transmission cycle. if the multiprocessor bit is 1, the cycle is an id transmission cycle; if the multiprocessor bit is 0, the cycle is a data transmission cycle. figure 13.13 shows an example of inter-processor communication using the multiprocessor format. the transmitting station first sends the id code of the receiving station with which it wants to perform serial communication as data with a 1 multiprocessor bit added. it then sends transmit data as data with a 0 multiprocessor bit added. when data with a 1 multiprocessor bit is received, the receiving station compares that data with its own id. the station whose id matches then receives the data sent next. stations whose ids do not match continue to skip data until data with a 1 multiprocessor bit is again received. the sci uses the mpie bit in scr to implement this function. when the mpie bit is set to 1, transfer of receive data from rsr to rdr, error flag detection, and setting the ssr status flags, rdrf, fer, and orer to 1, are inhibited until data with a 1 multiprocessor bit is received. on reception of a receive character with a 1 multiprocessor bit, the mpb bit in ssr is set to 1 and the mpie bit is automatically cleared, thus normal reception is resumed. if the rie bit in scr is set to 1 at this time, an rxi interrupt is generated. when the multiprocessor format is selected, the parity bit setting is rendered invalid. all other bit settings are the same as those in normal asynchronous mode. the clock used for multiprocessor communication is the same as that in normal asynchronous mode.
rev. 2.0, 09/02 page 335 of 658 transmitting station receiving station a receiving station b receiving station c receiving station d (id = 01) (id = 02) (id = 03) (id = 04) serial transmission line serial data id transmission cycle = receiving station specification data transmission cycle = data transmission to receiving station specified by id (mpb = 1) (mpb = 0) h'01 h'aa legend mpb: multiprocessor bit figure 13.13 example of communication using multiprocessor format (transmission of data h'aa to receiving station a) 13.5.1 multiprocessor serial data transmission figure 13.14 shows a sample flowchart for multiprocessor serial data transmission. for an id transmission cycle, set the mpbt bit in ssr to 1 before transmission. for a data transmission cycle, clear the mpbt bit in ssr to 0 before transmission. all other sci operations are the same as those in asynchronous mode.
rev. 2.0, 09/02, page 336 of 658 no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and set mpbt bit in ssr no yes no yes read tend flag in ssr [3] no yes [4] clear dr to 0 and set ddr to 1 clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 break output? clear tdre flag to 0 [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. after the te bit is set to 1, a frame of 1s is output, and transmission is enabled. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr. set the mpbt bit in ssr to 0 or 1. finally, clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dtc is activated by a transmit data empty interrupt (txi) request, and data is written to tdr. (h8s/2268 series only) [4] break output at the end of serial transmission: to output a break in serial transmission, set the port dr to 0, clear ddr to 1, then clear the te bit in scr to 0. figure 13.14 sample multiprocessor serial transmission flowchart
rev. 2.0, 09/02 page 337 of 658 13.5.2 multiprocessor serial data reception figure 13.16 shows a sample flowchart for multiprocessor serial data reception. if the mpie bit in scr is set to 1, data is skipped until data with a 1 multiprocessor bit is sent. on receiving data with a 1 multiprocessor bit, the receive data is transferred to rdr. an rxi interrupt request is generated at this time. all other sci operations are the same as in asynchronous mode. figure 13.15 shows an example of sci operation for multiprocessor format reception. mpie rdr value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 data (id1) start bit mpb stop bit start bit data (data1) mpb stop bit data (id2) start bit stop bit start bit data (data2) stop bit rxi interrupt request (multiprocessor interrupt) generated mark state (idle state) rdrf rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine if not this station ? s id, mpie bit is set to 1 again rxi interrupt request is not generated, and rdr retains its state id1 (a) data does not match station ? s id mpie rdr value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 mpb mpb rxi interrupt request (multiprocessor interrupt) generated mark state (idle state) rdrf rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine matches this station ? s id, so reception continues, and data is received in rxi interrupt service routine mpie bit set to 1 again id2 (b) data matches station ? s id data2 id1 mpie = 0 mpie = 0 figure 13.15 example of sci operation in reception (example with 8-bit data, multiprocessor bit, one stop bit)
rev. 2.0, 09/02, page 338 of 658 yes [1] no initialization start reception no yes [4] clear re bit in scr to 0 error processing (continued on next page) [5] no yes fer orer = 1 rdrf = 1 all data received? read mpie bit in scr [2] read orer and fer flags in ssr read rdrf flag in ssr [3] read receive data in rdr no yes this station ? s id? read orer and fer flags in ssr yes no read rdrf flag in ssr no yes fer orer = 1 read receive data in rdr rdrf = 1 [1] sci initialization: the rxd pin is automatically designated as the receive data input pin. [2] id reception cycle: set the mpie bit in scr to 1. [3] sci status check, id reception and comparison: read ssr and check that the rdrf flag is set to 1, then read the receive data in rdr and compare it with this station ? s id. if the data is not this station ? s id, set the mpie bit to 1 again, and clear the rdrf flag to 0. if the data is this station ? s id, clear the rdrf flag to 0. [4] sci status check and data reception: read ssr and check that the rdrf flag is set to 1, then read the data in rdr. [5] receive error processing and break detection: if a receive error occurs, read the orer and fer flags in ssr to identify the error. after performing the appropriate error processing, ensure that the orer and fer flags are all cleared to 0. reception cannot be resumed if either of these flags is set to 1. in the case of a framing error, a break can be detected by reading the rxd pin value. figure 13.16 sample multiprocessor serial reception flowchart (1)
rev. 2.0, 09/02 page 339 of 658 error processing yes no clear orer, per, and fer flags in ssr to 0 no yes no yes framing error processing overrun error processing orer = 1 fer = 1 break? clear re bit in scr to 0 [5] figure 13.16 sample multiprocessor serial reception flowchart (2)
rev. 2.0, 09/02, page 340 of 658 13.6 operation in clocked synchronous mode figure 13.17 shows the general format for clocked synchronous communication. in clocked synchronous mode, data is transmitted or received synchronous with clock pulses. in clocked synchronous serial communication, data on the transmission line is output from one falling edge of the serial clock to the next. in clocked synchronous mode, the sci receives data in synchronous with the rising edge of the serial clock. after 8-bit data is output, the transmission line holds the msb state. in clocked synchronous mode, no parity or multiprocessor bit is added. inside the sci, the transmitter and receiver are independent units, enabling full-duplex communication through the use of a common clock. both the transmitter and the receiver also have a double-buffered structure, so data can be read or written during transmission or reception, enabling continuous data transfer. don ? t care don ? t care one unit of transfer data (character or frame) bit 0 serial data synchronization clock bit 1 bit 3 bit 4 bit 5 lsb msb bit 2 bit 6 bit 7 * * note: * high except in continuous transfer figure 13.17 data format in synchronous communication (for lsb-first) 13.6.1 clock either an internal clock generated by the on-chip baud rate generator or an external synchronization clock input at the sck pin can be selected, according to the setting of cke0 and cke1 bits in scr. when the sci is operated on an internal clock, the serial clock is output from the sck pin. eight serial clock pulses are output in the transfer of one character, and when no transfer is performed the clock is fixed high. 13.6.2 sci initialization (clocked synchronous mode) before transmitting and receiving data, the te and re bits in scr should be cleared to 0, then the sci should be initialized as described in a sample flowchart in figure 13.18. when the operating mode, or transfer format, is changed for example, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1. note that clearing the re bit to 0 does not change the contents of the rdrf, per, fer, and orer flags, or the contents of rdr.
rev. 2.0, 09/02 page 341 of 658 wait start initialization set data transfer format in smr and scmr no yes set value in brr clear te and re bits in scr to 0 [2] [3] set te and re bits in scr to 1, and set rie, tie, teie, and mpie bits [4] 1-bit interval elapsed? set cke1 and cke0 bits in scr (te, re bits 0) [1] [1] set the clock selection in scr. be sure to clear bits rie, tie, teie, and mpie, te and re, to 0. [2] set the data transfer format in smr and scmr. [3] write a value corresponding to the bit rate to brr. not necessary if an external clock is used. [4] wait at least one bit interval, then set the te bit or re bit in scr to 1. also set the rie, tie teie, and mpie bits. setting the te and re bits enables the txd and rxd pins to be used. note: in simultaneous transmit and receive operations, the te and re bits should both be cleared to 0 or set to 1 simultaneously. figure 13.18 sample sci initialization flowchart
rev. 2.0, 09/02, page 342 of 658 13.6.3 serial data transmission (clocked synchronous mode) figure 13.19 shows an example of sci operation for transmission in clocked synchronous mode. in serial transmission, the sci operates as described below. 1. the sci monitors the tdre flag in ssr, and if the flag is 0, the sci recognizes that data has been written to tdr, and transfers the data from tdr to tsr. 2. after transferring data from tdr to tsr, the sci sets the tdre flag to 1 and starts transmission. if the tie bit in scr is set to 1 at this time, a transmit data empty interrupt (txi) is generated. continuous transmission is possible because the txi interrupt routine writes the next transmit data to tdr before transmission of the current transmit data has been completed. 3. 8-bit data is sent from the txd pin synchronized with the output clock when output clock mode has been specified, and synchronized with the input clock when use of an external clock has been specified. 4. the sci checks the tdre flag at the timing for sending the msb (bit 7). 5. if the tdre flag is cleared to 0, data is transferred from tdr to tsr, and serial transmission of the next frame is started. 6. if the tdre flag is set to 1, the tend flag in ssr is set to 1, and the tdre flag maintains the output state of the last bit. if the teie bit in scr is set to 1 at this time, a tei interrupt request is generated. the sck pin is fixed high. figure 13.20 shows a sample flow chart for serial data transmission. even if the tdre flag is cleared to 0, transmission will not start while a receive error flag (orer, fer, or per) is set to 1. make sure that the receive error flags are cleared to 0 before starting transmission. note that clearing the re bit to 0 does not clear the receive error flags. transfer direction bit 0 serial data synchronization clock 1 frame tdre tend data written to tdr and tdre flag cleared to 0 in txi interrupt service routine txi interrupt request generated bit 1 bit 7 bit 0 bit 1 bit 6 bit 7 txi interrupt request generated tei interrupt request generated figure 13.19 sample sci transmission operation in clocked synchronous mode
rev. 2.0, 09/02 page 343 of 658 no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and clear tdre flag in ssr to 0 no yes no yes read tend flag in ssr [3] clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dtc is activated by a transmit data empty interrupt (txi) request and data is written to tdr. (h8s/2268 series only) figure 13.20 sample serial transmission flowchart
rev. 2.0, 09/02, page 344 of 658 13.6.4 serial data reception (clocked synchronous mode) figure 13.21 shows an example of sci operation for reception in clocked synchronous mode. in serial reception, the sci operates as described below. 1. the sci performs internal initialization synchronous with a synchronous clock input or output, starts receiving data, and stores the received data in rsr. 2. if an overrun error occurs (when reception of the next data is completed while the rdrf flag in ssr is still set to 1), the orer bit in ssr is set to 1. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated, receive data is not transferred to rdr, and the rdrf flag remains to be set to 1. 3. if reception is completed successfully, the rdrf bit in ssr is set to 1, and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an rxi interrupt request is generated. continuous reception is possible because the rxi interrupt routine reads the receive data transferred to rdr before reception of the next receive data has finished. bit 7 serial data synchronization clock 1 frame rdrf orer eri interrupt request generated by overrun error rxi interrupt request generated rdr data read and rdrf flag cleared to 0 in rxi interrupt rxi interrupt request generated bit 0 bit 7 bit 0 bit 1 bit 6 bit 7 figure 13.21 example of sci operation in reception reception cannot be resumed while a receive error flag is set to 1. accordingly, clear the orer, fer, per, and rdrf bits to 0 before resuming reception. figure 13.22 shows a sample flow chart for serial data reception. an overrun error occurs or synchronous clocks are output until the re bit is cleared to 0 when an internal clock is selected and only receive operation is possible. when a transmission and reception will be carried out in a unit of one frame, be sure to carry out a dummy transmission with only one frame by the simultaneous transmit and receive operations at the same time.
rev. 2.0, 09/02 page 345 of 658 yes [1] no initialization start reception [2] no yes read rdrf flag in ssr [4] [5] clear re bit in scr to 0 error processing (continued below) [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes orer = 1 rdrf = 1 all data received? read orer flag in ssr error processing overrun error processing clear orer flag in ssr to 0 [3] [1] sci initialization: the rxd pin is automatically designated as the receive data input pin. [2] [3] receive error processing: if a receive error occurs, read the orer flag in ssr, and after performing the appropriate error processing, clear the orer flag to 0. transfer cannot be resumed if the orer flag is set to 1. [4] sci status check and receive data read: read ssr and check that the rdrf flag is set to 1, then read the receive data in rdr and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. [5] serial reception continuation procedure: to continue serial reception, before the final bit of the current frame is received, reading the rdrf flag, reading rdr, and clearing the rdrf flag to 0 should be finished. the rdrf flag is cleared automatically when the dtc is activated by a receive data full interrupt (rxi) request and the rdr value is read. (h8s/2268 series only) figure 13.22 sample serial reception flowchart
rev. 2.0, 09/02, page 346 of 658 13.6.5 simultaneous serial data transmission and reception (clocked synchronous mode) figure 13.23 shows a sample flowchart for simultaneous serial transmit and receive operations. the following procedure should be used for simultaneous serial data transmit and receive operations. to switch from transmit mode to simultaneous transmit and receive mode, after checking that the sci has finished transmission and the tdre and tend flags are set to 1, clear te to 0. then simultaneously set te and re to 1 with a single instruction. to switch from receive mode to simultaneous transmit and receive mode, after checking that the sci has finished reception, clear re to 0. then after checking that the rdrf and receive error flags (orer, fer, and per) are cleared to 0, simultaneously set te and re to 1 with a single instruction.
rev. 2.0, 09/02 page 347 of 658 yes [1] no initialization start transmission/reception [5] error processing [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes orer = 1 all data received? [2] read tdre flag in ssr no yes tdre = 1 write transmit data to tdr and clear tdre flag in ssr to 0 no yes rdrf = 1 read orer flag in ssr [4] read rdrf flag in ssr clear te and re bits in scr to 0 [1] sci initialization: the txd pin is designated as the transmit data output pin, and the rxd pin is designated as the receive data input pin, enabling simultaneous transmit and receive operations. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. transition of the tdre flag from 0 to 1 can also be identified by a txi interrupt. [3] receive error processing: if a receive error occurs, read the orer flag in ssr, and after performing the appropriate error processing, clear the orer flag to 0. transmission/reception cannot be resumed if the orer flag is set to 1. [4] sci status check and receive data read: read ssr and check that the rdrf flag is set to 1, then read the receive data in rdr and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. [5] serial transmission/reception continuation procedure: to continue serial transmission/ reception, before the final bitof the current frame is received, finish reading the rdrf flag, reading rdr, and clearing the rdrf flag to 0. also, before the final bit of the current frame is transmitted, read 1 from the tdre flag to confirm that writing is possible. then write data to tdr and clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dtc is activated by a transmit data empty interrupt (txi) request and data is written to tdr. also, the rdrf flag is cleared automatically when the dtc is activated by a receive data full interrupt (rxi) request and the rdr value is read. (h8s/2268 series only) note: when switching from transmit or receive operation to simultaneous transmit and receive operations, first clear the te bit and re bit to 0, then set both these bits to 1 by one instruction simultaneously. figure 13.23 sample flowchart of simultaneous serial transmit and receive operations
rev. 2.0, 09/02, page 348 of 658 13.7 operation in smart card interface the sci supports an ic card (smart card) interface that conforms to iso/iec 7816-3 (identification card) as a serial communication interface extension function. switching between the normal serial communication interface and the smart card interface mode is carried out by means of a register setting. 13.7.1 pin connection example figure 13.24 shows an example of connection with the smart card. in communication with an ic card, as both transmission and reception are carried out on a single data transmission line, the txd pin and rxd pin should be connected to the lsi pin. the data transmission line should be pulled up to the v cc power supply with a resistor. if an ic card is not connected, and the te and re bits are both set to 1, closed transmission/reception is possible, enabling self-diagnosis to be carried out. when the clock generated on the smart card interface is used by an ic card, the sck pin output is input to the clk pin of the ic card. this lsi port output is used as the reset signal. txd rxd this lsi v cc i/o connected equipment ic card data line clock line reset line clk rst sck rx (port) figure 13.24 schematic diagram of smart card interface pin connections 13.7.2 data format (except for block transfer mode) figure 13.25 shows the transfer data format in smart card interface mode. ? one frame consists of 8-bit data plus a parity bit in asynchronous mode. ? in transmission, a guard time of at least 2 etu (elementary time unit: the time for transfer of one bit) is left between the end of the parity bit and the start of the next frame. ? if a parity error is detected during reception, a low error signal level is output for one etu period, 10.5 etu after the start bit. ? if an error signal is sampled during transmission, the same data is retransmitted automatically after a delay of 2 etu or longer.
rev. 2.0, 09/02 page 349 of 658 ds d0 d1 d2 d3 d4 d5 d6 d7 dp when there is no parity error transmitting station output ds d0 d1 d2 d3 d4 d5 d6 d7 dp when a parity error occurs transmitting station output de receiving station output : start bit : data bits : parity bit : error signal legend ds d0 to d7 dp de figure 13.25 normal smart card interface data format data transfer with other types of ic cards (direct convention and inverse convention) are performed as described in the following. ds azzazz z za a (z) (z) state d0 d1 d2 d3 d4 d5 d6 d7 dp figure 13.26 direct convention (sdir = sinv = o/ e e e e = 0) with the direction convention type ic and the above sample start character, the logic 1 level corresponds to state z and the logic 0 level to state a, and transfer is performed in lsb-first order. the start character data above is h'3b. for the direct convention type, clear the sdir and sinv bits in scmr to 0. according to smart card regulations, clear the o/ e bit in smr to 0 to select even parity mode. ds azzaaa z aa a (z) (z) state d7 d6 d5 d4 d3 d2 d1 d0 dp figure 13.27 inverse convention (sdir = sinv = o/ e e e e = 1) with the inverse convention type, the logic 1 level corresponds to state a and the logic 0 level to state z, and transfer is performed in msb-first order. the start character data for the above is h'3f. for the inverse convention type, set the sdir and sinv bits in scmr to 1. according to smart card regulations, even parity mode is the logic 0 level of the parity bit, and corresponds to state z. in this lsi, the sinv bit inverts only data bits d0 to d7. therefore, set the o/ e bit in smr to 1 to invert the parity bit for both transmission and reception.
rev. 2.0, 09/02, page 350 of 658 13.7.3 block transfer mode operation in block transfer mode is the same as that in the normal smart card interface mode, except for the following points. ? in reception, though the parity check is performed, no error signal is output even if an error is detected. however, the per bit in ssr is set to 1 and must be cleared before receiving the parity bit of the next frame. ? in transmission, a guard time of at least 1 etu is left between the end of the parity bit and the start of the next frame. ? in transmission, because retransmission is not performed, the tend flag is set to 1, 11.5 etu after transmission start. ? as with the normal smart card interface, the ers flag indicates the error signal status, but since error signal transfer is not performed, this flag is always cleared to 0. 13.7.4 receive data sampling timing and reception margin in smart card interface mode an internal clock generated by the on-chip baud rate generator can only be used as a transmission/reception clock. in this mode, the sci operates on a basic clock with a frequency of 32, 64, 372, or 256 times the transfer rate (fixed to 16 times in normal asynchronous mode) as determined by bits bcp1 and bcp0. in reception, the sci samples the falling edge of the start bit using the basic clock, and performs internal synchronization. as shown in figure 13.28, by sampling receive data at the rising-edge of the 16th, 32nd, 186th, or 128th pulse of the basic clock, data can be latched at the middle of the bit. the reception margin is given by the following formula. m = | (0.5 ? ) ? (l ? 0.5) f ? (1 + f) | 100% 1 2n | d ? 0.5 | n where m: reception margin (%) n: ratio of bit rate to clock (n = 32, 64, 372, and 256) d: clock duty (d = 0 to 1.0) l: frame length (l = 10) f: absolute value of clock frequency deviation assuming values of f = 0, d = 0.5 and n = 372 in the above formula, the reception margin formula is as follows. m = (0.5 ? 1/2 372) 100% = 49.866%
rev. 2.0, 09/02 page 351 of 658 internal basic clock 372 clocks 186 clocks receive data (rxd) synchronization sampling timing d0 d1 data sampling timing 185 371 0 371 185 0 0 start bit figure 13.28 receive data sampling timing in smart card mode (using clock of 372 times the transfer rate) 13.7.5 initialization before transmitting and receiving data, initialize the sci as described below. initialization is also necessary when switching from transmit mode to receive mode, or vice versa. 1. clear the te and re bits in scr to 0. 2. clear the error flags ers, per, and orer in ssr to 0. 3. set the gm, blk, o/ e , bcp0, bcp1, cks0, cks1 bits in smr. set the pe bit to 1. 4. set the smif, sdir, and sinv bits in scmr. when the smif bit is set to 1, the txd and rxd pins are both switched from ports to sci pins, and are placed in the high-impedance state. 5. set the value corresponding to the bit rate in brr. 6. set the cke0 and cke1 bits in scr. clear the tie, rie, te, re, mpie, and teie bits to 0. if the cke0 bit is set to 1, the clock is output from the sck pin. 7. wait at least one bit interval, then set the tie, rie, te, and re bits in scr. do not set the te bit and re bit at the same time, except for self-diagnosis. to switch from receive mode to transmit mode, after checking that the sci has finished reception, initialize the sci, and set re to 0 and te to 1. whether sci has finished reception or not can be checked with the rdrf, per, or orer flags. to switch from transmit mode to receive mode, after checking that the sci has finished transmission, initialize the sci, and set te to 0 and re to 1. whether sci has finished transmission or not can be checked with the tend flag.
rev. 2.0, 09/02, page 352 of 658 13.7.6 serial data transmission (except for block transfer mode) as data transmission in smart card interface mode involves error signal sampling and retransmission processing, the operations are different from those in normal serial communication interface mode (except for block transfer mode). figure 13.29 illustrates the retransfer operation when the sci is in transmit mode. 1. if an error signal is sent back from the receiving end after transmission of one frame is complete, the ers bit in ssr is set to 1. if the rie bit in scr is enabled at this time, an eri interrupt request is generated. the ers bit in ssr should be cleared to 0 by the time the next parity bit is sampled. 2. the tend bit in ssr is not set for a frame in which an error signal indicating an abnormality is received. data is retransferred from tdr to tsr, and retransmitted automatically. 3. if an error signal is not sent back from the receiving end, the ers bit in ssr is not set. transmission of one frame, including a retransfer, is judged to have been completed, and the tend bit in ssr is set to 1. if the tie bit in scr is enabled at this time, a txi interrupt request is generated. writing transmit data to tdr transfers the next transmit data. figure 13.31 shows a flowchart for transmission. in the h8s/2268 series, a sequence of transmit operations can be performed automatically by specifying the dtc to be activated with a txi interrupt source. in a transmit operation, the tdre flag is set to 1 at the same time as the tend flag in ssr is set, and a txi interrupt will be generated if the tie bit in scr has been set to 1. if the txi request is designated beforehand as a dtc activation source, the dtc will be activated by the txi request, and transfer of the transmit data will be carried out. the tdre and tend flags are automatically cleared to 0 when data is transferred by the dtc. in the event of an error, the sci retransmits the same data automatically. during this period, the tend flag remains cleared to 0 and the dtc is not activated. therefore, the sci and dtc will automatically transmit the specified number of bytes in the event of an error, including retransmission. however, the ers flag is not cleared automatically when an error occurs, and so the rie bit should be set to 1 beforehand so that an eri request will be generated in the event of an error, and the ers flag will be cleared. when performing transfer using the dtc, it is essential to set and enable the dtc before carrying out sci setting. for details of the dtc setting procedures, refer to section 8, data transfer controller (dtc).
rev. 2.0, 09/02 page 353 of 658 d0 d1 d2 d3 d4 d5 d6 d7 dp de ds d0 d1 d2 d3 d4 d5 d6 d7 dp (de) ds d0 d1 d2 d3 d4 ds transfer frame n+1 retransferred frame nth transfer frame tdre tend fer/ers transfer to tsr from tdr transfer to tsr from tdr transfer to tsr from tdr figure 13.29 retransfer operation in sci transmit mode the timing for setting the tend flag depends on the value of the gm bit in smr. the tend flag set timing is shown in figure 13.30. ds d0 d1 d2 d3 d4 d5 d6 d7 dp i/o data 12.5etu txi (tend interrupt) 11.0etu de guard time when gm = 0 when gm = 1 : start bit : data bits : parity bit : error signal legend ds d0 to d7 dp de figure 13.30 tend flag generation timing in transmission operation
rev. 2.0, 09/02, page 354 of 658 initialization no yes clear te bit to 0 start transmission start no no no yes yes yes yes no end write data to tdr, and clear tdre flag in ssr to 0 error processing error processing tend = 1? all data transmitted ? tend = 1? ers = 0? ers = 0? figure 13.31 example of transmission processing flow
rev. 2.0, 09/02 page 355 of 658 13.7.7 serial data reception (except for block transfer mode) data reception in smart card interface mode uses the same operation procedure as for normal serial communication interface mode. figure 13.32 illustrates the retransfer operation when the sci is in receive mode. 1. if an error is found when the received parity bit is checked, the per bit in ssr is automatically set to 1. if the rie bit in scr is set at this time, an eri interrupt request is generated. the per bit in ssr should be kept cleared to 0 until the next parity bit is sampled. 2. the rdrf bit in ssr is not set for a frame in which an error has occurred. 3. if no error is found when the received parity bit is checked, the per bit in ssr is not set to 1, the receive operation is judged to have been completed normally, and the rdrf flag in ssr is automatically set to 1. if the rie bit in scr is enabled at this time, an rxi interrupt request is generated. figure 13.33 shows a flowchart for reception. in the h8s/2268 series, a sequence of receive operations can be performed automatically by specifying the dtc to be activated using an rxi interrupt source. in a receive operation, an rxi interrupt request is generated when the rdrf flag in ssr is set to 1. if the rxi request is designated beforehand as a dtc activation source, the dtc will be activated by the rxi request, and the receive data will be transferred. the rdrf flag is cleared to 0 automatically when data is transferred by the dtc. if an error occurs in receive mode and the orer or per flag is set to 1, a transfer error interrupt (eri) request will be generated. hence, so the error flag must be cleared to 0. in the event of an error, the dtc is not activated and receive data is skipped. therefore, receive data is transferred for only the specified number of bytes in the event of an error. even when a parity error occurs in receive mode and the per flag is set to 1, the data that has been received is transferred to rdr and can be read from there. note: for details on receive operations in block transfer mode, refer to section 13.4, operation in asynchronous mode. d0 d1 d2 d3 d4 d5 d6 d7 dp de ds d0 d1 d2 d3 d4 d5 d6 d7 dp (de) ds d0 d1 d2 d3 d4 ds transfer frame n+1 retransferred frame nth transfer frame rdrf per figure 13.32 retransfer operation in sci receive mode
rev. 2.0, 09/02, page 356 of 658 initialization read rdr and clear rdrf flag in ssr to 0 clear re bit to 0 start reception start error processing no no no yes yes orer = 0 and per = 0 rdrf = 1? all data received? yes figure 13.33 example of reception processing flow 13.7.8 clock output control when the gm bit in smr is set to 1, the clock output level can be fixed with bits cke0 and cke1 in scr. at this time, the minimum clock pulse width can be made the specified width. figure 13.34 shows the timing for fixing the clock output level. in this example, gm is set to 1, cke1 is cleared to 0, and the cke0 bit is controlled. specified pulse width sck cke0 specified pulse width figure 13.34 timing for fixing clock output level when turning on the power or switching between smart card interface mode and software standby mode, the following procedures should be followed in order to maintain the clock duty.
rev. 2.0, 09/02 page 357 of 658 powering on: to secure clock duty from power-on, the following switching procedure should be followed. 1. the initial state is port input and high impedance. use a pull-up resistor or pull-down resistor to fix the potential. 2. fix the sck pin to the specified output level with the cke1 bit in scr. 3. set smr and scmr, and switch to smart card mode operation. 4. set the cke0 bit in scr to 1 to start clock output. when changing from smart card interface mode to software standby mode: 1. set the data register (dr) and data direction register (ddr) corresponding to the sck pin to the value for the fixed output state in software standby mode. 2. write 0 to the te bit and re bit in the serial control register (scr) to halt transmit/receive operation. at the same time, set the cke1 bit to the value for the fixed output state in software standby mode. 3. write 0 to the cke0 bit in scr to halt the clock. 4. wait for one serial clock period. during this interval, clock output is fixed at the specified level, with the duty preserved. 5. make the transition to the software standby state. when returning to smart card interface mode from software standby mode: 1. exit the software standby state. 2. write 1 to the cke0 bit in scr and output the clock. signal generation is started with the normal duty. software standby normal operation normal operation figure 13.35 clock halt and restart procedure
rev. 2.0, 09/02, page 358 of 658 13.8 interrupt sources 13.8.1 interrupts in normal serial communication interface mode table 13.12 shows the interrupt sources in normal serial communication interface mode. a different interrupt vector is assigned to each interrupt source, and individual interrupt sources can be enabled or disabled using the enable bits in scr. when the tdre flag in ssr is set to 1, a txi interrupt request is generated. when the tend flag in ssr is set to 1, a tei interrupt request is generated. a txi interrupt can activate the dtc to perform data transfer. the tdre flag is cleared to 0 automatically when data is transferred by the dtc. (h8s/2268 series only) when the rdrf flag in ssr is set to 1, an rxi interrupt request is generated. when the orer, per, or fer flag in ssr is set to 1, an eri interrupt request is generated. an rxi interrupt request can activate the dtc to transfer data. the rdrf flag is cleared to 0 automatically when data is transferred by the dtc. (h8s/2268 series only) a tei interrupt is requested when the tend flag is set to 1 and the teie bit is set to 1. if a tei interrupt and a txi interrupt are requested simultaneously, the txi interrupt has priority for acceptance. however, if the tdre and tend flags are cleared simultaneously by the txi interrupt routine, the sci cannot branch to the tei interrupt routine later.
rev. 2.0, 09/02 page 359 of 658 table 13.12 interrupt sources of serial communication interface mode channel name interrupt source interrupt flag dtc activation * 2 priority * 1 eri0 receive error orer, fer, per not possible high rxi0 receive data full rdrf possible txi0 transmit data empty tdre possible 0 tei0 transmission end tend not possible eri1 receive error orer, fer, per not possible rxi1 receive data full rdrf possible txi1 transmit data empty tdre possible 1 tei1 transmission end tend not possible eri2 receive error orer, fer, per not possible rxi2 receive data full rdrf possible txi2 transmit data empty tdre possible 2 tei2 transmission end tend not possible low notes: 1. indicates the initial state immediately after a reset. priorities in channels can be changed by the interrupt controller. (h8s/2268 series only) 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 360 of 658 13.8.2 interrupts in smart card interface mode table 13.13 shows the interrupt sources in smart card interface mode. the transmit end interrupt (tei) request cannot be used in this mode. note: in case of block transfer mode, see 13.8.1, interrupts in nomal serial communication interface mode. table 13.13 interrupt sources in smart card interface mode channel name interrupt source interrupt flag dtc activation * 2 priority * 1 eri0 receive error, detection orer, per, ers not possible high rxi0 receive data full rdrf possible 0 txi0 transmit data empty tend possible eri1 receive error, detection orer, per, ers not possible rxi1 receive data full rdrf possible 1 txi1 transmit data empty tend possible eri2 receive error, detection orer, per, ers not possible rxi2 receive data full rdrf possible 2 txi2 transmit data empty tend possible low notes: 1. indicates the initial state immediately after a reset. priorities in channels can be changed by the interrupt controller. (h8s/2268 series only) 2. supported only by the h8s/2268 series. 13.9 usage notes 13.9.1 module stop mode setting sci operation can be disabled or enabled using the module stop control register. the initial setting is for sci operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 22, power-down modes. 13.9.2 break detection and processing (asynchronous mode only) when framing error (fer) detection is performed, a break can be detected by reading the rxd pin value directly. in a break, the input from the rxd pin becomes all 0s, setting the fer flag, and possibly the per flag. note that as the sci continues the receive operation after receiving a break, even if the fer flag is cleared to 0, it will be set to 1 again.
rev. 2.0, 09/02 page 361 of 658 13.9.3 mark state and break detection (asynchronous mode only) when te is 0, the txd pin is used as an i/o port whose direction (input or output) and level are determined by ddr. this can be used to set the txd pin to mark state (high level) or send a break during serial data transmission. to maintain the communication line at mark state until te is set to 1, set both ddr and dr to 1. as te is cleared to 0 at this point, the txd pin becomes an i/o port, and 1 is output from the txd pin. to send a break during serial transmission, first set pdr to 1 and dr to 0, and then clear te to 0. when te is cleared to 0, the transmitter is initialized regardless of the current transmission state, the txd pin becomes an i/o port, and 0 is output from the txd pin. 13.9.4 receive error flags and transmit operations (clocked synchronous mode only) transmission cannot be started when a receive error flag (orer, per, or fer) is set to 1, even if the tdre flag is cleared to 0. be sure to clear the receive error flags to 0 before starting transmission. note also that receive error flags cannot be cleared to 0 even if the re bit is cleared to 0. 13.9.5 restrictions on use of dtc (h8s/2268 series only) ? when an external clock source is used as the serial clock, the transmit clock should not be input until at least 5 clock cycles after tdr is updated by the dtc. misoperation may occur if the transmit clock is input within 4 clocks after tdr is updated. (figure 13.36) ? when rdr is read by the dtc, be sure to set the activation source to the relevant sci reception data full interrupt (rxi). t d0 lsb serial data sck d1 d3 d4 d5 d2 d6 d7 note: when operating on an external clock, set t >4 clocks. tdre figure 13.36 example of clocked synchronous transmission by dtc
rev. 2.0, 09/02, page 362 of 658 13.9.6 operation in case of mode transition ? transmission operation should be stopped (by clearing te, tie, and teie to 0) before making a module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. tsr, tdr, and ssr are reset. the output pin states in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode depend on the port settings, and becomes high-level output after the relevant mode is cleared. if a transition is made during transmission, the data being transmitted will be undefined. when transmitting without changing the transmit mode after the relevant mode is cleared, transmission can be started by setting te to 1 again, and performing the following sequence: ssr read -> tdr write -> tdre clearance. to transmit with a different transmit mode after clearing the relevant mode, the procedure must be started again from initialization. figure 13.37 shows a sample flowchart for mode transition during transmission. port pin states are shown in figures 13.38 and 13.39. operation should also be stopped (by clearing te, tie, and teie to 0) before making a transition from transmission by dtc transfer to module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. to perform transmission with the dtc after the relevant mode is cleared, setting te and tie to 1 will set the txi flag and start dtc transmission. (h8s/2268 series only) ? reception receive operation should be stopped (by clearing re to 0) before making a module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. rsr, rdr, and ssr are reset. if a transition is made without stopping operation, the data being received will be invalid. to continue receiving without changing the reception mode after the relevant mode is cleared, set re to 1 before starting reception. to receive with a different receive mode, the procedure must be started again from initialization. figure 13.40 shows a sample flowchart for mode transition during reception.
rev. 2.0, 09/02 page 363 of 658 read tend flag in ssr te = 0 transition to software standby mode, etc. exit from software standby mode, etc. change operating mode? no all data transmitted? tend = 1 yes yes yes no no [1] [3] [2] te = 1 initialization [1] data being transmitted is interrupted. after exiting software standby mode, etc., normal cpu transmission is possible by setting te to 1, reading ssr, writing tdr, and clearing tdre to 0, but note that if the dtc has been activated, the remaining data in dtcram will be transmitted when te and tie are set to 1. (h8s/2268 series only) [2] if tie and teie are set to 1, clear them to 0 in the same way. [3] includes module stop mode, watch mode, subactive mode, and subsleep mode. figure 13.37 sample flowchart for mode transition during transmission sck output pin te bit txd output pin port input/output high output port input/output high output start stop start of transmission end of transmission port input/output sci txd output port sci txd output port transition to software standby exit from software standby figure 13.38 asynchronous transmission using internal clock
rev. 2.0, 09/02, page 364 of 658 port input/output last txd bit held high output * port input/output marking output port input/output sci txd output port port note: * initialized by software standby. sck output pin te bit txd output pin sci txd output start of transmission end of transmission transition to software standby exit from software standby figure 13.39 synchronous transmission using internal clock re = 0 transition to software standby mode, etc. read receive data in rdr read rdrf flag in ssr exit from software standby mode, etc. change operating mode? no rdrf = 1 yes yes no [1] [2] re = 1 initialization [1] receive data being received becomes invalid. [2] includes module stop mode, watch mode, subactive mode, and subsleep mode. figure 13.40 sample flowchart for mode transition during reception
rev. 2.0, 09/02 page 365 of 658 13.9.7 switching from sck pin function to port pin function: ? problem in operation: when switching the sck pin function to the output port function (high- level output) by making the following settings while ddr = 1, dr = 1, c/ a = 1, cke1 = 0, cke0 = 0, and te = 1 (synchronous mode), low-level output occurs for one half-cycle. 1. end of serial data transmission 2. te bit = 0 3. c/ a bit = 0 ... switchover to port output 4. occurrence of low-level output (see figure 13.41) sck/port data te c/a cke1 cke0 bit 7 bit 6 1. end of transmission 4. low-level output 3. c/ = 0 2. te = 0 half-cycle low-level output figure 13.41 operation when switching from sck pin function to port pin function ? sample procedure for avoiding low-level output: as this sample procedure temporarily places the sck pin in the input state, the sck/port pin should be pulled up beforehand with an external circuit. with ddr = 1, dr = 1, c/ a = 1, cke1 = 0, cke0 = 0, and te = 1, make the following settings in the order shown. 1. end of serial data transmission 2. te bit = 0 3. cke1 bit = 1 4. c/ a bit = 0 ... switchover to port output 5. cke1 bit = 0
rev. 2.0, 09/02, page 366 of 658 sck/port data te c/a cke1 cke0 bit 7 bit 6 1. end of transmission 3. cke1 = 1 5. cke1 = 0 4. c/ = 0 2. te = 0 high-level output figure 13.42 operation when switching from sck pin function to port pin function (example of preventing low-level output) 13.9.8 assignment and selection of registers some serial communication interface registers are assigned to the same address as other registers. register selection is performed by means of the iice bit in the serial control register (scrx). for details on register addresses, see section 25, list of registers.
rev. 2.0, 09/02, page 367 of 658 section 14 i 2 c bus interface (iic) (option) an i 2 c bus interface is available as an option. observe the following notes when using this option. 1. for mask-rom versions, a w is added to the part number in products in which this optional function is used. examples: hd6432268wte 2. the product number is identical for f-ztat versions. however, be sure to inform your hitachi sales representative if you will be using this option. the h8s/2268 series has an internal i 2 c bus interface of two channels, while the h8s/2264 series has that of one channel. the i 2 c bus interface conforms to and provides a subset of the philips i 2 c bus (inter-ic bus) interface functions. the register configuration that controls the i 2 c bus differs partly from the philips configuration, however. the i 2 c bus interface data transfer is performed using a data line (sda) and a clock line (scl) for each channel, which allows efficient use of connectors and the area of the pcb. 14.1 features ? selection of i 2 c format or clocked synchronous serial format ? i 2 c bus format: addressing format with acknowledge bit, for master/slave operation ? clocked synchronous serial format: non-addressing format without acknowledge bit, for master operation only i 2 c bus format ? two ways of setting slave address ? start and stop conditions generated automatically in master mode ? selection of acknowledge output levels when receiving ? automatic loading of acknowledge bit when transmitting ? wait function in master mode a wait can be inserted by driving the scl pin low after data transfer, excluding acknowledgement. the wait can be cleared by clearing the interrupt flag. ? wait function in slave mode a wait request can be generated by driving the scl pin low after data transfer, excluding acknowledgement. the wait request is cleared when the next transfer becomes possible. iicic05b_000020020700
rev. 2.0, 09/02, page 368 of 658 ? three interrupt sources ? data transfer end (including transmission mode transition with i2c bus format and address reception after loss of master arbitration) ? address match: when any slave address matches or the general call address is received in slave receive mode ? stop condition detection ? selection of 16 internal clocks (in master mode) ? direct bus drive ? two pins, p35/scl0 and p34/sda0, function as nmos open-drain outputs when the bus drive function is selected. ? two pins ? p33/scl1 and p32/sda1 ? function as nmos-only outputs when the bus drive function is selected. (h8s/2268 series only) figure 14.1 shows a block diagram of the i 2 c bus interface. figure 14.2 shows an example of i/o pin connections to external circuits. channel i/o pins are nmos open drains, and it is possible to apply voltages in excess of the power supply (vcc) voltage for this lsi. set the upper limit of voltage applied to the power supply (vcc) power supply range +0.3v, i.e.5.8.v. channel 1 (h8s/2268 series only) i/o pins are driven solely by nmos, so in terms of appearance they carry out the same operations as an nmos open drain. however, the voltage which can be applied to the i/o pins depends on the voltage of the power supply (vcc) of this lsi.
rev. 2.0, 09/02, page 369 of 658 ps noise canceler noise canceler clock control bus state decision circuit arbitration decision circuit output data control circuit address comparator sar, sarx interrupt generator icdrs icdrr icdrt icsr icmr iccr internal data bus interrupt request scl sda legend : iccr: icmr: icsr: icdr: sar: sarx: ps: i 2 c bus control register i 2 c bus mode register i 2 c bus status register i 2 c bus data register slave address register slave address register x prescaler figure 14.1 block diagram of i 2 c bus interface
rev. 2.0, 09/02, page 370 of 658 scl in out sda in out (slave 1) scl sda scl in out sda in out (slave 2) scl sda scl in out sda in out (master) this lsi scl sda v dd v cc scl sda figure 14.2 i 2 c bus interface connections (example: this lsi as master) 14.2 input/output pins table 14.1 shows the pin configuration for the i 2 c bus interface. table 14.1 pin configuration name abbreviation * 1 i/o function serial clock scl0 i/o iic_0 serial clock input/output serial data sda0 i/o iic_0 serial data input/output serial clock * 2 scl1 i/o iic_1 serial clock input/output serial data * 2 sda1 i/o iic_1 serial data input/output notes: 1. in the text, the channel subscript is omitted, and only scl and sda are used. 2. supported only by the h8s/2268 series. 14.3 register descriptions the i 2 c bus interface has the following registers. registers icdr and sarx and registers icmr and sar are allocated to the same addresses. accessible addresses differ depending on the ice bit in iccr. sar and sarx are accessed when ice is 0, and icmr and icdr are accessed when ice is 1. for details on the module stop control register, refer to section 22.1.2, module stop control registers a to d (mstpcra to mstpcrd).
rev. 2.0, 09/02, page 371 of 658 ? i 2 c bus data register_0 (icdr_0) ? slave address register_0 (sar_0) ? second slave address register_0 (sarx_0) ? i 2 c bus mode register_0 (icmr_0) ? i 2 c bus control register_0 (iccr_0) ? i 2 c bus status register_0 (icsr_0) ? i 2 c bus data register_1 (icdr_1)* ? slave address register_1 (sar_1)* ? second slave address register_1 (sarx_1)* ? i 2 c bus mode register_1 (icmr_1)* ? i 2 c bus control register_1 (iccr_1)* ? i 2 c bus status register_1 (icsr_1)* ? ddc switch register (ddcswr) ? serial control register (scrx) note: * supported only by the h8s/2268 series. 14.3.1 i 2 c bus data register (icdr) icdr is an 8-bit readable/writable register that is used as a transmit data register when transmitting and a receive data register when receiving. icdr is divided internally into a shift register (icdrs), receive buffer (icdrr), and transmit buffer (icdrt). data transfers among the three registers are performed automatically in coordination with changes in the bus state, and affect the status of internal flags such as tdre and rdrf. when tdre is 1 and the transmit buffer is empty, tdre shows that the next transmit data can be written from the cpu. when rdrf is 1, it shows that the valid receive data is stored in the receive buffer. if i 2 c is in transmit mode and the next data is in icdrt (the tdre flag is 0) following transmission/reception of one frame of data using icdrs, data is transferred automatically from icdrt to icdrs. if i 2 c is in receive mode and no previous data remains in icdrr (the rdrf flag is 0) following transmission/reception of one frame of data using icdrs, data is transferred automatically from icdrs to icdrr. if the number of bits in a frame, excluding the acknowledge bit, is less than 8, transmit data and receive data are stored differently. transmit data should be written justified toward the msb side when mls = 0, and toward the lsb side when mls = 1. receive data bits read from the lsb side should be treated as valid when mls = 0, and bits read from the msb side when mls = 1. icdr can be written and read only when the ice bit is set to 1 in iccr. the value of icdr is undefined after a reset.
rev. 2.0, 09/02, page 372 of 658 the tdre and rdrf flags are set and cleared under the conditions shown below. setting the tdre and rdrf flags affects the status of the interrupt flags. bit bit name initial value r/w description ? tdre ?? transmit data register empty [setting conditions] ? in transmit mode, when a start condition is detected in the bus line state after a start condition is issued in master mode with the i 2 c bus format or serial format selected ? when data is transferred from icdrt to icdrs ? when a switch is made from receive mode to transmit mode after detection of a start condition [clearing conditions] ? when transmit data is written in icdr in transmit mode ? when a stop condition is detected in the bus line state after a stop condition is issued with the i 2 c bus format or serial format selected ? when a stop condition is detected with the i 2 c bus format selected ? in receive mode ? rdrf ?? receive data register full [setting condition] when data is transferred from icdrs to icdrr [clearing condition] when icdr (icdrr) receive data is read in receive mode
rev. 2.0, 09/02, page 373 of 658 14.3.2 slave address register (sar) sar selects the slave address and selects the transfer format. sar can be written and read only when the ice bit is cleared to 0 in iccr. bit bit name initial value r/w description 7 6 5 4 3 2 1 sva6 sva5 sva4 sva3 sva2 sva1 sva0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w slave address 6 to 0 sets a slave address 0 fs 0 r/w selects the transfer format together with the fsx bit in sarx. refer to table 14.2. 14.3.3 second slave address register (sarx) sarx stores the second slave address and selects the transfer format. sarx can be written and read only when the ice bit is cleared to 0 in iccr. bit bit name initial value r/w description 7 6 5 4 3 2 1 svax6 svax5 svax4 svax3 svax2 svax1 svax0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w slave address 6 to 0 sets the second slave address 0 fsx 1 r/w selects the transfer format together with the fs bit in sar. refer to table 14.2.
rev. 2.0, 09/02, page 374 of 658 table 14.2 transfer format sar sarx fs fsx i 2 c transfer format 0 0 sar and sarx are used as the slave addresses with the i 2 c bus format. 0 1 only sar is used as the slave address with the i 2 c bus format. 1 0 only sarx is used as the slave address with the i 2 c bus format. 1 1 clock synchronous serial format (sar and sarx are invalid) 14.3.4 i 2 c bus mode register (icmr) icmr sets the transfer format and transfer rate. it can only be accessed when the ice bit in iccr is 1. bit bit name initial value r/w description 7 mls 0 r/w msb-first/lsb-first select 0: msb-first 1: lsb-first set this bit to 0 when the i 2 c bus format is used. 6 wait 0 r/w wait insertion bit this bit is valid only in master mode with the i 2 c bus format. when wait is set to 1, after the fall of the clock for the final data bit, the iric flag is set to 1 in iccr, and a wait state begins (with scl at the low level). when the iric flag is cleared to 0 in iccr, the wait ends and the acknowledge bit is transferred. if wait is cleared to 0, data and acknowledge bits are transferred consecutively with no wait inserted. the iric flag in iccr is set to 1 on completion of the acknowledge bit transfer, regardless of the wait setting. 5 4 3 cks2 cks1 cks0 0 0 0 r/w r/w r/w serial clock select 2 to 0 this bit is valid only in master mode. these bits select the required transfer rate, together with the iicx 1 and iicx0 bit in scrx. refer table 14.3.
rev. 2.0, 09/02, page 375 of 658 bit bit name initial value r/w description 2 1 0 bc2 bc1 bc0 0 0 0 r/w r/w r/w bit counter 2 to 0 these bits specify the number of bits to be transferred next. with the i 2 c bus format, the data is transferred with one addition acknowledge bit. bit bc2 to bc0 settings should be made during an interval between transfer frames. if bits bc2 to bc0 are set to a value other than 000, the setting should be made while the scl line is low. the value returns to 000 at the end of a data transfer, including the acknowledge bit. i 2 c bus format clocked synchronous mode 000: 9 bit 000: 8 bit 001: 2 bit 001: 1 bit 010: 3 bit 010: 2 bit 011: 4 bit 011: 3 bit 100: 5 bit 100: 4 bit 101: 6 bit 101: 5 bit 110: 7 bit 110: 6 bit 111: 8 bit 111: 7 bit
rev. 2.0, 09/02, page 376 of 658 table 14.3 i 2 c transfer rate scrx icmr bit 5 or 6 bit 5 bit 4 bit 3 transfer rate iicx cks2 cks1 cks0 clock = = = = 5 mhz = = = = 8 mhz = = = = 10 mhz = = = = 16 mhz = = = = 20 mhz 0000 /28 179mhz 286khz 357khz 571khz * 714khz * 0001 /40 125khz 200khz 250khz 400khz 500khz * 0010 /48 104khz 167khz 208khz 333khz 417khz 0011 /64 78.1khz 125khz 156khz 250khz 313khz 0100 /80 62.5khz 100khz 125khz 200khz 250khz 0101 /100 50.0khz 80.0khz 100khz 160khz 200khz 0110 /112 44.6khz 71.4khz 89.3khz 143khz 179khz 0111 /128 39.1khz 62.5khz 78.1khz 125khz 156khz 1000 /56 89.3khz 143khz 179khz 286khz 357khz 1001 /80 62.5khz 100khz 125khz 200khz 250khz 1010 /96 52.1khz 83.3khz 104khz 167khz 208khz 1011 /128 39.1khz 62.5khz 78.1khz 125khz 156khz 1100 /160 31.3khz 50.0khz 62.5khz 100khz 125khz 1101 /200 25.0khz 40.0khz 50.0khz 80.0khz 100khz 1110 /224 22.3khz 35.7khz 44.6khz 71.4khz 89.3khz 1111 /256 19.5khz 31.3khz 39.1khz 62.5khz 78.1khz note: * out of the range of the i2c bus interface specification (normal mode: 100khz in max. and high-speed mode: 400khz in max)
rev. 2.0, 09/02, page 377 of 658 14.3.5 serial control register (scrx) scrx controls the iic operating modes. bit bit name initial value r/w description 7 ? 0r/wreserved the initial value should not be changed. 6 5 iicx1 * iicx0 0 0 r/w r/w i 2 c transfer rate select 1 and 0 selects the transfer rate in master mode, together with bits cks2 to cks0 in icmr. refer to table 14.3. note: * in the h8s/2264 series, this bit is reserved. 4 iice 0 r/w i 2 c master enable controls cpu access to the iic data register and control registers (iccr, icsr, icdr/sarx, and icmr/sar). 0: cpu access to the iic data register and control registers is disabled. 1: cpu access to the iic data register and control registers is enabled. 3 flshe 0 r/w for details on this bit, refer to section 20.5.7, serial control register x (scrx). 2 to 0 ? all 0 r/w reserved the initial value should not be changed.
rev. 2.0, 09/02, page 378 of 658 14.3.6 i 2 c bus control register (iccr) i 2 c bus control register (iccr) consists of the control bits and interrupt request flags of i 2 c bus interface. bit bit name initial value r/w description 7ice 0 r/wi 2 c bus interface enable when this bit is set to 1, the i 2 c bus interface module is enabled to send/receive data and drive the bus since it is connected to the scl and sda pins. icmr and icdr can be accessed. when this bit is cleared, the module is halted and separated from the scl and sda pins. sar and sarx can be accessed. 6ieic 0 r/wi 2 c bus interface interrupt enable when this bit is 1, interrupts are enabled by iric. 5 4 mst trs 0 0 r/w master/slave select transmit/receive select 00: slave receive mode 01: slave transmit mode 10: master receive mode 11: master transmit mode both these bits will be cleared by hardware when they lose in a bus contention in master mode of the i 2 c bus format. in slave receive mode, the r/ w bit in the first frame immediately after the start automatically sets these bits in receive mode or transmit mode by using hardware. the settings can be made again for the bits that were set/cleared by hardware, by reading these bits. when the trs bit is intended to change during a transfer, the bit will not be switched until the frame transfer is completed, including acknowledgement.
rev. 2.0, 09/02, page 379 of 658 bit bit name initial value r/w description 3 acke 0 r/w acknowledge bit judgement selection 0: the value of the acknowledge bit is ignored, and continuous transfer is performed. the value of the received acknowledge bit is not indicated by the ackb bit, which is always 0. 1: if the acknowledge bit is 1, continuous transfer is interrupted. in the h8s/2268 series, the dtc * can be used to perform continuous transfer. the dtc * is activated when the irtr interrupt flag is set to 1 (irtr us one of two interrupt flags, the other being iric). when the acke bit is 0, the tdre, iric, and irtr flags are set on completion of data transmission, regardless of the acknowledge bit. when the acke bit is 1, the tdre, iric, and irtr flags are set on completion of data transmission when the acknowledge bit is 0, and the iric flag alone is set on completion of data transmission when the acknowledge bit is 1. when the dtc * is activated, the tdre, iric, and irtr flags are cleared to 0 after the specified number of data transfers have been executed. consequently, interrupts are not generated during continuos data transfer, but if data transmission is completed with a 1 acknowledge bit when the acke bit is set to 1, the dtc * is not activated and an interrupt is generated, if enabled. depending on the receiving device, the acknowledge bit may be significant, in indicating completion of processing of the received data, for instance, or may be fixed at 1 and have no significance. note: * supported only by the h8s/2268 series. 2 bbsy 0 r/w bus busy in slave mode, reading the bbsy flag enables to confirm whether the i 2 c bus is occupied or released. the bbsy flag is set to 0 when the sda level changes from high to low under the condition of scl = high, assuming that the start condition has been issued. the bbsy flag is cleared to 0 when the sda level changes from low to high under the condition of scl = high, assuming that the start condition has been issued. writing to the bbsy flag in slave mode is disabled. in master mode, the bbsy flag is used to issue start and stop conditions. write 1 to bbsy and 0 to scp to issue a start condition. follow this procedure when also re- transmitting a start condition. to issue a start/stop condition, use the mov instruction. the i 2 c bus interface must be set in master transmit mode before the issue of a start condition.
rev. 2.0, 09/02, page 380 of 658 bit bit name initial value r/w description 1 iric 0 r/w i 2 c bus interface interrupt request flag also see table 14.4. [setting conditions] in i 2 c bus format master mode ? when a start condition is detected in the bus line state after a start condition is issued (when the tdre flag is set to 1 because of first frame transmission) ? when a wait is inserted between the data and acknowledge bit when wait = 1 ? at the end of data transfer (when the tdre or rdrf flag is set to 1) ? when a slave address is received after bus arbitration is lost (when the al flag is set to1) ? when 1 is received as the acknowledge bit when the acke bit is 1(when the ackb bit is set to 1) in i 2 c bus format slave mode ? when the slave address (sva, svax) matches (when the aas and aasx flags are set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) ? when the general call address is detected (when the adz flag is set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection(when the tdre or rdrf flag is set to 1) ? when 1 is received as the acknowledge bit when the acke bit is 1(when the ackb bit is set to 1) ? when a stop condition is detected(when the stop or estp flag is set to 1) with clocked synchronous serial format ? at the end of data transfer (when the tdre or rdrf flag is set to 1) ? when a start condition is detected with serial format selected when a condition occurs in which internal flag of tdre and rdfr is set to 1 except for the above [clearing condition] when 0 is written in iric after reading iric = 1 ? when icdr is read/written by dtc (h8s/2268 series only) (when tdre or rdrf flag is cleared to 0) (as it might not be a condition to clear, for details, see description of dtc operation below)
rev. 2.0, 09/02, page 381 of 658 bit bit name initial value r/w description 0 scp 1 r/w start condition/stop condition prohibit bit the scp bit controls the issue of start/stop conditions in master mode. to issue a start condition, write 1 in bbsy and 0 in scp. a retransmit start condition is issued in the same way. to issue a stop condition, write 0 in bbsy and 0 in scp. this bit is always read as 1. if 1 is written, the data is not stored. when, with the i 2 c bus format selected, iric is set to 1 and an interrupt is generated, other flags must be checked in order to identify the source that set iric to 1. although each source has a corresponding flag, caution is needed at the end of a transfer. when the tdre or rdrf internal flag is set, the readable irtr flag may or may not be set. in the h8s/2268 series, even when data transfer is complete, the dtc activation request flag, irtr, is not set until a retransmission start condition or stop condition is detected after a slave address (sva) or general call address matched in the i 2 c bus format slave mode. even when the iric flag and irtr flag are set, the tdre or rdrf internal flag may not be set. for a continuous transfer using the dtc in the h8s/2268 series, the iric or irtr flag is not cleared at the completion of the specified number of times of transfers. on the other hand, the tdre and rdrf flags are cleared because the specified number of times of read/write operations have been complete. table 14.4 shows the relationship between the flags and the transfer states.
rev. 2.0, 09/02, page 382 of 658 table 14.4 flags and transfer states mst trs bbsy estp stop irtr aasx al aas adz ackb state 1/01/0000000000idle state (flag clearing r equired) 11000000000start c ondition issuance 11100100000start c ondition established 11/0100000000/1master m ode wait 11/0100100000/1master m ode transmit/receive end 0010001/011/01/00arbitration lost 00100000100sar match by first frame in slave mode 00100000110g eneral call address match 00100010000sarx match 01/0100000000/1slave m ode transmit/receive end(except after sarx match) 0 0 1/0 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 slave mode transmit/receive end(after sarx match) 0 1/0 0 1/0 1/0 0 0 0 0 0 0/1 stop condition detected 14.3.7 i 2 c bus status register (icsr) icsr consists of status flags. bit bit name initial value r/w description 7 estp 0 r/(w) * error stop condition detection flag this bit is valid in i 2 c bus format slave mode. [setting condition] when a stop condition is detected during frame transfer. [clearing condition] ? when 0 is written in estp after reading the state of 1 ? when the iric flag is cleared to 0 6stop 0 r/(w) * normal stop condition detection flag this bit is valid in i 2 c bus format slave mode. [setting condition] when a stop condition is detected during frame transfer. [clearing condition] ? when 0 is written in stop after reading stop = 1 ? when the iric flag is cleared to 0
rev. 2.0, 09/02, page 383 of 658 bit bit name initial value r/w description 5 irtr 0 r/(w) * i 2 c bus interface continuous transmission/reception interrupt request flag [setting conditions] in i 2 c bus interface slave mode ? when the tdre or rdrf flag is set to 1 when aasx = 1 in i 2 c bus interface other modes ? when the tdre or rdrf flag is set to 1 [clearing conditions] ? when 0 is written in irtr after reading irtr = 1 ? when the iric flag is cleared to 0 4 aasx 0 r/(w) * second slave address recognition flag [setting condition] when the second slave address is detected in slave receive mode and fsx = 0 [clearing conditions] ? when 0 is written in aasx after reading aasx = 1 ? when a start condition is detected ? in master mode 3al 0 r/(w) * arbitration lost flag indicates that bus arbitration was lost in master mode. [setting condition] ? when the internal sda and sda pin do not match at the rise of scl. ? when the internal scl is high at the fall of scl. [clearing conditions] ? when 0 is written in al after reading al = 1 ? when icdr data is written (transmit mode) or read (receive mode)
rev. 2.0, 09/02, page 384 of 658 bit bit name initial value r/w description 2 aas 0 r/(w) * slave address recognition flag [setting condition] when the slave address or general call address is detected in slave receive mode and fs = 0. [clearing conditions] ? when icdr data is written (transmit mode) or read (receive mode) ? when 0 is written in aas after reading aas = 1 ? in master mode 1adz 0 r/(w) * general call address recognition flag this bit is valid in i 2 c bus format slave receive mode. [setting condition] when the general call address is detected in slave receive mode and fsx = 0 or fs = 0. [clearing conditions] ? when icdr data is written (transmit mode) or read (receive mode) ? when 0 is written in adz after reading adz = 1 ? in master mode 0 ackb 0 r/(w) * acknowledge bit stores acknowledge bit. 0: at reception, outputs 0 in the acknowledge output timing. at transmission, indicates that acknowledge was sent (0) from the receive device. 1: at reception, outputs 1 in the acknowledge output timing. at transmission, indicates that acknowledge was not sent (1) from the receive device. note: only a 0 can be written to this bit, to clear the flag.
rev. 2.0, 09/02, page 385 of 658 14.3.8 ddc switch register (ddcswr) ddcswr controls the i 2 c bus interface format automatic switching function and internal latch clear. bit bit name initial value r/w description 7 to 4 ? all 0 r/(w) * 1 reserved the write value should always be 0. 3 2 1 0 clr3 clr2 clr1 clr0 1 1 1 1 w w w w i 2 c bus interface clear 3 to 0: when bits clr3 to clr0 are set, a clear signal is generated for the i 2 c bus interface internal latch circuit, and the internal state is initialized. the write data for these bits is not retained. to perform i 2 c clearance, bits clr3 to clr0 must be written to simultaneously using an mov instruction. do not use a bit manipulation instruction such as bclr. 00xx: setting prohibited 0100: setting prohibited 0101: iic_0 internal latch cleared 0110: iic_1 * 2 internal iatch cleared 0111: iic_0, iic_1 * 2 internal iatch cleared 1xxx: invalid setting legend x: don?t care notes: 1. only 0 can be written to these bits, to clear the flag. 2. supported only by the h8s/2268 series. 14.4 operation the i 2 c bus interface has serial and i 2 c bus formats. 14.4.1 i 2 c bus data format the i 2 c bus formats are addressing formats and an acknowledge bit is inserted. the first frame following a start condition always consists of 8 bits. the i 2 c bus format is shown in figure 14.3. the serial format is a non-addressing format with no acknowledge bit. this is shown in figure 14.4. figure 14.5 shows the i 2 c bus timing.
rev. 2.0, 09/02, page 386 of 658 s sla r/ a data a a/ p 1111 n 7 1 m (a) i 2 c bus format (fs = 0 or fsx = 0) (b) i 2 c bus format (start condition retransmission, fs = 0 or fsx = 0) n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) s sla r/ a data 111 n1 7 1 m1 s sla r/ a data a/ p 111 n2 7 1 m2 11 1 a/ n1 and n2: transfer bit count (n1 and n2 = 1 to 8) m1 and m2: transfer frame count (m1 and m2 1) 11 figure 14.3 i 2 c bus data formats (i 2 c bus formats) s data data p 11 n 8 1 m fs = 1 and fsx = 1 n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) figure 14.4 i 2 c bus data format (serial format) sda scl s 1-7 sla 8 r/ 9 a 1-7 data 89 1-7 89 a data p a/ figure 14.5 i 2 c bus timing legend s: start condition. the master device drives sda from high to low while scl is high sla: slave address r/ w : indicates the direction of data transfer: from the slave device to the master device when r/ w is 1, or from the master device to the slave device when r/ w is 0 a: acknowledge. the receiving device drives sda data:transferred data p: stop condition. the master device drives sda from low to high while scl is high
rev. 2.0, 09/02, page 387 of 658 14.4.2 master transmit operation in i 2 c bus format master transmit mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. the transmission procedure and operations synchronized with the icdr writing are described below. 1. set the ice bit in iccr to 1. set bits mls, wait, and cks2 to cks0 in icmr, and bit iicx in scrx, according to the operating mode. 2. read the bbsy flag in iccr to confirm that the bus is free. 3. set bits mst and trs to 1 in iccr to select master transmit mode. 4. write 1 to bbsy and 0 to scp. this changes sda from high to low when scl is high, and generates the start condition. 5. then iric and irtr flags are set to 1. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. 6. write the data (slave address + r/ w ) to icdr. with the i 2 c bus format (when the fs bit in sar or the fsx bit in sarx is 0), the first frame data following the start condition indicates the 7-bit slave address and transmit/receive direction. as indicating the end of the transfer, and so the iric flag is cleared to 0. after writing icdr, clear iric continuously not to execute other interrupt handling routine. if one frame of data has been transmitted before the iric clearing, it can not be determine the end of transmission. the master device sequentially sends the transmission clock and the data written to icdr using the timing shown in figure 14.6. the selected slave device (i.e. the slave device with the matching slave address) drives sda low at the 9th transmit clock pulse and returns an acknowledge signal. 7. when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. 8. read the ackb bit in icsr to confirm that ackb is cleared to 0. when the slave device has not acknowledged (ackb bit is 1), operate the step [12] to end transmission, and retry the transmit operation. 9. write the transmit data to icdr. as indicating the end of the transfer, and so the iric flag is cleared to 0. perform the icdr write and the iric flag clearing sequentially, just as in point 6 in this flowchart. transmission of the next frame is performed in synchronization with the internal clock. 10. when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. 11. read the ackb bit in icsr. confirm that the slave device has been acknowledged (ackb bit is 0). when there is data to be transmitted, go to the step [9] to continue next transmission. when the slave device has not acknowledged (ackb bit is set to 1), operate the step [12] to end transmission.
rev. 2.0, 09/02, page 388 of 658 12. clear the iric flag to 0. and write 0 to bbsy and scp in iccr. this changes sda from low to high when scl is high, and generates the stop condition. sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 slave address bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric irtr icdr scl (master output) start condition generation data 1 address + r/ [4] write bbsy = 1 and scp = 0 (start condition issuance) [9] iric clearance [9] icdr write [6] iric clearance user processing slave address data 1 r/ [7] [5] a [6] icdr write normal operation icdr writing prohibited note: * data write timing in icdr * figure 14.6 master transmit mode operation timing example (mls = wait = 0) 14.4.3 master receive operation in master receive mode, the master device outputs the receive clock, receives data, and returns an acknowledge signal. the slave device transmits data. the reception procedure and operations with the wait function synchronized with the icdr read operation to receive data in sequence are shown below. 1. clear the trs bit in iccr to 0 to switch from transmit mode to receive mode, and set the wait bit in icmr to 1. also clear the bit in icsr to ackb 0 (acknowledge data setting). 2. when icdr is read (dummy data read), reception is started, and the receive clock is output, and data received, in synchronization with the internal clock. in order to detect wait operation, set the iric flag in iccr must be cleared to 0. after reading icdr, clear iric continuously not to execute other interrupt handling routine. if one frame of data has been received before the iric clearing, it cannot be determine the end of reception.
rev. 2.0, 09/02, page 389 of 658 3. the iric flag is set to 1 at the fall of the 8th receive clock pulse. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. scl is automatically fixed low in synchronization with the internal clock until the iric flag clearing. if the first frame is the last receive data, execute step [10] to halt reception. 4. clear the iric flag to release from the wait state. the master device outputs the 9th clock and drives sda at the 9th receive clock pulse to return an acknowledge signal. 5. when one frame of data has been received, the iric flag in iccr and the irtr flag in icsr are set to 1 at the rise of the 9th receive clock pulse. the master device outputs scl clock to receive next data. 6. read icdr. 7. clear the iric flag to detect next wait operation. data reception process from [5] to [7] should be executed during one byte reception period after iric flag clearing in [4] or [9] to release wait status. 8. the iric flags set to 1 at the fall of 8th receive clock pulse. scl is automatically fixed low in synchronization with the internal clock until the iric flag clearing. if this frame is the last receive data, execute step [10] to halt reception. 9. clear the iric flag in iccr to cancel wait operation. the master device drives sda low at the 9th receive clock pulse and returns an acknowledge signal. 10. data can be received continuously by repeating step [5] to [9]. 11. set the ackb bit in icsr to 1 so as to return ?no acknowledge? data. also set the trs bit in iccr to 1 to switch from receive mode to transmit mode. 12. clear iric flag to 0 to release from the wait state. 13. when one frame of data has been received, the iric flag is set to 1 at the rise of the 9th receive clock pulse. 14. clear the wait bit to 0 to switch from wait mode to no wait mode. read icdr and clear the iric flag to 0. clearing of the iric flag should be after the wait = 0. if the wait bit is cleared to 0 after clearing the iric flag and then an instruction to issue a stop condition is executed, the stop condition cannot be issued because the output level of the sda line is fixed as low. 15. clear the bbsy bit and scp bit to 0. this changes sda from low to high when scl is high, and generates the stop condition.
rev. 2.0, 09/02, page 390 of 658 sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric irtr icdr scl (master output) data 1 [1] trs cleared to 0 wait set to 1 ackb cleared to 0 [7] iric clearance [6] icdr read (data 1) [4] iric clearance [2] iric clearance user processing bit 5 bit 4 bit 3 5 4 3 9 data 1 data 2 [3] [5] a [2] icdr read (dummy read) master tansmit mode master receive mode a figure 14.7 (1) master receive mode operation timing example (mls = ackb = 0, wait = 1) sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric irtr icdr scl (master output) data 3 [9] iric clearance [7] iric clearance [9] iric clearance [6] icdr read (data 3) [7] iric clearance user processing 9 8 data 3 data 4 [8] [5] [8] [5] a a [6] icdr read (data 2) bit 0 data 2 data 2 data 1 figure 14.7 (2) master receive mode operation timing example (mls = ackb = 0, wait = 1)
rev. 2.0, 09/02, page 391 of 658 14.4.4 slave receive operation in slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. the reception procedure and operations in slave receive mode are described below. 1. set the ice bit in iccr to 1. set the mls bit in icmr and the mst and trs bits in iccr according to the operating mode. 2. when the start condition output by the master device is detected, the bbsy flag in iccr is set to 1. 3. when the slave address matches in the first frame following the start condition, the device operates as the slave device specified by the master device. if the 8th data bit (r/ w ) is 0, the trs bit in iccr remains cleared to 0, and slave receive operation is performed. 4. at the 9th clock pulse of the receive frame, the slave device drives sda low and returns an acknowledge signal. at the same time, the iric flag in i ccr is set to 1. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. if the rdrf internal flag has been cleared to 0, it is set to 1, and the receive operation continues. if the rdrf internal flag has been set to 1, the slave device drives scl low from the fall of the receive clock until data is read into icdr. 5. read icdr and clear the iric flag in iccr to 0. the rdrf flag is cleared to 0. receive operations can be performed continuously by repeating steps [4] and [5]. when sda is changed from low to high when scl is high, and the stop condition is detected, the bbsy flag in iccr is cleared to 0.
rev. 2.0, 09/02, page 392 of 658 sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) start condition issuance scl (slave output) interrupt request generation address + r/ address + r/ [5] icdr read [5] iric clearance user processing slave address data 1 [4] a r/ figure 14.8 example of slave receive mode operation timing (1) (mls = ackb = 0)
rev. 2.0, 09/02, page 393 of 658 sda (master output) sda (slave output) 2 14 36 58 79 8 79 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) scl (slave output) interrupt request generation interrupt request generation data 2 data 2 data 1 data 1 [5] icdr read [5] iric clearance user processing data 2 data 1 [4] [4] a a figure 14.9 example of slave receive mode operation timing (2) (mls = ackb = 0) 14.4.5 slave transmit operation in slave transmit mode, the slave device outputs the transmit data, while the master device outputs the receive clock and returns an acknowledge signal. the transmission procedure and operations in slave transmit mode are described below. 1. set the ice bit in iccr to 1. set the mls bit in icmr and the mst and trs bits in iccr according to the operating mode. 2. when the slave address matches in the first frame following detection of the start condition, the slave device drives sda low at the 9th clock pulse and returns an acknowledge signal. at the same time, the iric flag in iccr is set to 1. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. if the 8th data bit (r/ w ) is 1, the trs bit in iccr is set to 1, and the mode changes to slave transmit mode automatically. the tdre internal flag is set to 1. the slave device drives scl low from the fall of the transmit clock until icdr data is written.
rev. 2.0, 09/02, page 394 of 658 3. after clearing the iric flag to 0, write data to icdr. the tdre internal flag is cleared to 0. the written data is transferred to icdrs, and the tdre internal flag and the iric and irtr flags are set to 1 again. after clearing the iric flag to 0, write the next data to icdr. the slave device sequentially sends the data written into icdr in accordance with the clock output by the master device at the timing shown in figure 14.10. 4. when one frame of data has been transmitted, the iric flag in iccr is set to 1 at the rise of the 9th transmit clock pulse. if the tdre internal flag has been set to 1, this slave device drives scl low from the fall of the transmit clock until data is written to icdr. the master device drives sda low at the 9th clock pulse, and returns an acknowledge signal. as this acknowledge signal is stored in the ackb bit in icsr, this bit can be used to determine whether the transfer operation was performed normally. when the tdre internal flag is 0, the data written into icdr is transferred to icdrs, transmission is started, and the tdre internal flag and the iric and irtr flags are set to 1 again. 5. to continue transmission, clear the iric flag to 0, then write the next data to be transmitted into icdr. the tdre flag is cleared to 0. transmit operations can be performed continuously by repeating steps [4] and [5]. to end transmission, write h'ff to icdr. when sda is changed from low to high when scl is high, and the stop condition is detected, the bbsy flag in iccr is cleared to 0.
rev. 2.0, 09/02, page 395 of 658 sda (slave output) sda (master output) scl (slave output) 2 1 2 1 4 36 58 79 9 8 bit 7 bit 6 bit 5 bit 7 bit 6 bit 4 bit 3 bit 2 bit 1 bit 0 iric icdrs icdrt tdre scl (master output) interrupt request generation interrupt request generation interrupt request generation slave receive mode slave transmit mode data 1 data 2 [3] iric clearance [5] iric clearance [3] icdr write [3] icdr write [5] icdr write user processing data 1 data 1 data 2 data 2 a r/ a [3] [2] figure 14.10 example of slave transmit mode operation timing (mls = 0)
rev. 2.0, 09/02, page 396 of 658 14.4.6 iric setting timing and scl control the interrupt request flag (iric) is set at different times depending on the wait bit in icmr, the fs bit in sar, and the fsx bit in sarx. if the tdre or rdrf internal flag is set to 1, scl is automatically held low after one frame has been transferred; this timing is synchronized with the internal clock. figure 14.11 shows the iric set timing and scl control. (a) when wait = 0, and fs = 0 or fsx = 0 (i 2 c bus format, no wait) scl sda iric user processing clear iric write to icdr (transmit) or read icdr (receive) 1 a 8 1 1 a 7 1 89 7 (b) when wait = 1, and fs = 0 or fsx = 0 (i 2 c bus format, wait inserted) scl sda iric user processing clear iric clear iric write to icdr (transmit) or read icdr (receive) scl sda iric user processing (c) when fs = 1 and fsx = 1 (synchronous serial format) clear iric write to icdr (transmit) or read icdr (receive) 8 89 8 7 1 8 7 1 figure 14.11 iric setting timing and scl control
rev. 2.0, 09/02, page 397 of 658 14.4.7 operation using the dtc (h8s/2268 series only) the i 2 c bus format provides for selection of the slave device and transfer direction by means of the slave address and the r/ w bit, confirmation of reception with acknowledge bit, indication of the last frame, and so on. therefore, continuous data transfer using the dtc must be carried out in conjunction cpu processing by means of interrupts. table 14.5 shows some example of processing using the dtc. these examples assume that the number of transfer data bytes is know in slave mode. table 14.5 flags and transfer states item master transmit mode master receive mode slave transmit mode slave receive mode slave address + r/w bit transmission/ reception transmission by dtc (icdr rite) transmission by dtc (icdr rite) reception by cpu (icdr read) reception by cpu (icdr read) dummy data read ? processing by dtc (icdr read) ?? actual data transmission/rec eption transmission by dtc (icdr write) reception by cpu (icdr read) transmission by dtc (icdr write) reception by cpu (icdr read) dummy data (h ff) write ?? processing by dtc (icdr write) ? last frame processing not necessary reception by cpu (icdr read) not necessary reception by cpu (icdr read) transfer request processing after last frame processing 1st time: clearing by cpu 2nd time: end condition issuance by cpu not necessary automatic clearing on detection of end condition during transmission of dummy data (h ff) not necessary setting of number of dtc transfer data frames transmission: actual data count + 1 (+ 1 equivalent to slave address + r/ w bits) reception: actual data count transmission: actual data count + 1 (+ 1 equivalent to dummy data (h ff)) reception: actual data count
rev. 2.0, 09/02, page 398 of 658 14.4.8 noise chancellor the logic levels at the scl and sda pins are routed through noise chancellors before being latched internally. figure 14.12 shows a block diagram of the noise cancelled circuit. the noise chancellor consists of two cascaded latches and a match detector. the scl (or sda) input signal is sampled on the system clock, but is not passed forward to the next circuit unless the outputs of both latches agree. if they do not agree, the previous value is held. system clock period sampling clock c dq latch c dq latch scl or sda input signal match detector internal scl or sda signal sampling clock figure 14.12 block diagram of noise chancellor 14.4.9 sample flowcharts figures 14.13 to 14.16 show sample flowcharts for using the i 2 c bus interface in each mode.
rev. 2.0, 09/02, page 399 of 658 start initialize set mst = 1 and trs = 1 in iccr write bbsy =1 and scp = 0 in iccr write transmit data in icdr clear iric in iccr no no yes yes yes yes no no [1] initialization [3] select master transmit mode. [4] start condition issuance [6] set transmit data for the first byte (slave address + r/ ). (after writing icdr, clear iric continuously) [9] set transmit data for the second and subsequent bytes. (after writing icdr, clear iric immediately) [2] test the status of the scl and sda lines. [7] wait for 1 byte to be transmitted. [10] wait for 1 byte to be transmitted. [11] test for end of tranfer [12] stop condition issuance [8] test the acknowledge bit, transferred from slave device. [5] wait for a start condition read iric in iccr read ackb in icsr iric = 1? ackb = 0? transmit mode? write transmit data in icdr clear iric in iccr read iric in iccr read ackb in icsr clear iric in iccr end of transmission? or ackb = 1? write bbsy = 0 and scp = 0 in iccr end read bbsy in iccr bbsy = 0? yes no read iric in iccr iric = 1? yes no yes no iric = 1? master receive mode figure 14.13 sample flowchart for master transmit mode
rev. 2.0, 09/02, page 400 of 658 master receive operation clear iric in iccr yes no yes yes no yes no [1] select receive mode. [3] wait for 1 byte to be received. [4] clear iric. (to end the wait insertion) [6] read the receive data. [9] clear iric. (to end the wait insertion) [2] start receiving. the first read is a dummy read. after reading icdr, please clear iric immediately. [7] clear iric. [10] set acknowledge data for the last reception. [11] clear iric. (to end the wait insertion) [12] wait for 1 byte to be received. [13] --------- clear iric. (note: after setting wait = 0, iric should be cleared to 0.) [14] stop condition issuance. [8] wait for the next data to be received. [5] wait for 1 byte to be received. read iric in iccr read icdr clear iric in iccr iric = 1? iric = 1? yes last receive? last receive? set ackb = 1 in icsr set trs = 1 in iccr clear iric = 1 in iccr read iric in iccr set wait = 0 in icmr read icdr clear iric in iccr write bbsy = 0 and scp = 0 in iccr end set trs = 0 in iccr set ackb = 0 in icsr read iric in iccr iric = 1? yes no no read iric in iccr clear iric in iccr no iric = 1? set wait = 1 in icmr clear iric in iccr read icdr figure 14.14 sample flowchart for master receive mode
rev. 2.0, 09/02, page 401 of 658 start initialize set mst = 0 and trs = 0 in iccr set ackb = 0 in icsr read iric in iccr iric = 1? yes no clear iric in iccr read aas and adz in icsr aas = 1 and adz = 0? read trs in iccr trs = 0? no yes no yes yes no yes yes no no [1] [2] [3] [4] [5] [6] [7] [8] last receive? read icdr read iric in iccr iric = 1? clear iric in iccr set ackb = 1 in icsr read icdr read iric in iccr read icdr iric = 1? clear iric in iccr end general call address processing * description omitted slave transmit mode [1] select slave receive mode. [2] wait for the first byte to be received (slave address). [3] start receiving. the first read is a dummy read. [4] wait for the transfer to end. [5] set acknowledge data for the last reception. [6] start the last reception. [7] wait for the transfer to end. [8] read the last receive data. figure 14.15 sample flowchart for slave receive mode
rev. 2.0, 09/02, page 402 of 658 slave transmit mode write transmit data in icdr read iric in iccr iric = 1? clear iric in iccr clear iric in iccr clear iric in iccr read ackb in icsr set trs = 0 in iccr end of transmission (ackb = 1)? yes no no yes end [1] [2] [3] read icdr [5] [4] [1] set transmit data for the second and subsequent bytes. [2] wait for 1 byte to be transmitted. [3] test for end of transfer. [4] set slave receive mode. [5] dummy read (to release the scl line). figure 14.16 sample flowchart for slave transmit mode
rev. 2.0, 09/02, page 403 of 658 14.5 usage notes 1. in master mode, if an instruction to generate a start condition is immediately followed by an instruction to generate a stop condition, neither condition will be output correctly. to output consecutive start and stop conditions, after issuing the instruction that generates the start condition, read the relevant ports, check that scl and sda are both low, then issue the instruction that generates the stop condition. note that scl may not yet have gone low when bbsy is cleared to 0. 2. either of the following two conditions will start the next transfer. pay attention to these conditions when reading or writing to icdr. ? write access to icdr when ice = 1 and trs = 1 (including automatic transfer from icdrt to icdrs) ? read access to icdr when ice = 1 and trs = 0 (including automatic transfer from icdrs to icdrr) 3. table 14.6 shows the timing of scl and sda output in synchronization with the internal clock. timings on the bus are determined by the rise and fall times of signals affected by the bus load capacitance, series resistance, and parallel resistance. table 14.6 i 2 c bus timing (scl and sda output) item symbol output timing unit notes scl output cycle time t sclo 28t cyc to 256t cyc ns scl output high pulse width t sclho 0.5t sclo ns scl output low pulse width t scllo 0.5t sclo ns sda output bus free time t bufo 0.5t sclo ? 1t cyc ns start condition output hold time t staho 0.5t sclo ? 1t cyc ns retransmission start condition output setup time t staso 1t sclo ns stop condition output setup time t stoso 0.5t sclo + 2t cyc ns data output setup time (master) t sdaso 1t scllo ? 3t cyc ns data output setup time (slave) 1t scll ? 3t cyc ns data output hold time t sdaho 3t cyc ns 4. scl and sda inputs are sampled in synchronization with the internal clock. the ac timing therefore depends on the system clock cycle t cyc , as shown in table 26.8 in section 26, electrical characteristics. note that the i 2 c bus interface ac timing specifications will not be met with a system clock frequency of less than 5 mhz.
rev. 2.0, 09/02, page 404 of 658 5. the i 2 c bus interface specification for the scl rise time t sr is under 1000 ns (300 ns for high- speed mode). in master mode, the i 2 c bus interface monitors the scl line and synchronizes one bit at a time during communication. if t sr (the time for scl to go from low to v ih ) exceeds the time determined by the input clock of the i 2 c bus interface, the high period of scl is extended. the scl rise time is determined by the pull-up resistance and load capacitance of the scl line. to insure proper operation at the set transfer rate, adjust the pull-up resistance and load capacitance so that the scl rise time does not exceed the values given in the table in table 14.7. table 14.7 permissible scl rise time (t sr ) values time indication iicx t cyc indication i 2 c bus specification (max.) = 5 mhz = 8 mhz = 10 mhz = 16 mhz = 20 mhz 07.5t cyc normal mode 1000 ns 1000 ns 937 ns 750 ns 468 ns 375 ns high-speed mode 300 ns 300 ns 300 ns 300 ns 300 ns 300 ns 1 17.5t cyc normal mode 1000 ns 1000 ns 1000 ns 1000 ns 1000 ns 875 ns high-speed mode 300 ns 300 ns 300 ns 300 ns 300 ns 300 ns 6. the i 2 c bus interface specifications for the scl and sda rise and fall times are under 1000 ns and 300 ns. the i 2 c bus interface scl and sda output timing is prescribed by t scyc and t cyc , as shown in table 14.6. however, because of the rise and fall times, the i 2 c bus interface specifications may not be satisfied at the maximum transfer rate. table 14.8 shows output timing calculations for different operating frequencies, including the worst-case influence of rise and fall times. the values in the above table will vary depending on the settings of the iicx bit and bits cks0 to cks2. depending on the frequency it may not be possible to achieve the maximum transfer rate; therefore, whether or not the i 2 c bus interface specifications are met must be determined in accordance with the actual setting conditions. t bufo fails to meet the i 2 c bus interface specifications at any frequency. the solution is either (a) to provide coding to secure the necessary interval (approximately 1 s) between issuance of a stop condition and issuance of a start condition, or (b) to select devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus. t scllo in high-speed mode and t staso in standard mode fail to satisfy the i 2 c bus interface specifications for worst-case calculations of t sr /t sf . possible solutions that should be investigated include (a) adjusting the rise and fall times by means of a pull-up resistor and capacitive load, (b) reducing the transfer rate to meet the specifications, or (c) selecting devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus.
rev. 2.0, 09/02, page 405 of 658 table 14.8 i 2 c bus timing (with maximum influence of t sr /t sf ) time indication (at maximum transfer rate) [ns] item t cyc indication t sr /t sf influence (max.) i 2 c bus specifi- cation (min.) = 5 mhz = 8 mhz = 10 mhz = 16 mhz = 20 mhz t sclho 0.5t sclo (?t sr ) standard mode ?1000 4000 4000 4000 4000 4000 4000 high-speed mode ?300 600 950 950 950 950 950 t scllo 0.5t sclo (?t sf ) standard mode ?250 4700 4750 4750 4750 4750 4750 high-speed mode ?250 1300 1000 * 1 1000 * 1 1000 * 1 1000 * 1 1000 * 1 t bufo 0.5t sclo ?1t cyc standard mode ?1000 4700 3800 * 1 3875 * 1 3900 * 1 3938 * 1 3950 * 1 ( ?t sr ) high-speed mode ?300 1300 750 * 1 825 * 1 850 * 1 888 * 1 900 * 1 t staho 0.5t sclo ?1t cyc standard mode ?250 4000 4550 4625 4650 4688 4700 (?t sf ) high-speed mode ?250 600 800 875 900 938 950 t staso 1t sclo (?t sr ) standard mode ?1000 4700 9000 9000 9000 9000 9000 high-speed mode ?300 600 2200 2200 2200 2200 2200 t stoso 0.5t sclo + 2t cyc standard mode ?1000 4000 4400 4250 4200 4125 4100 (?t sr ) high-speed mode ?300 600 1350 1200 1150 1075 1050 t sdaso 1t scllo * 2 ?3t cyc standard mode ?1000 250 3100 3325 3400 3513 3550 (master) (?t sr ) high-speed mode ?300 100 400 625 700 813 850 t sdaso 1t scll * 2 ?3t cyc * 2 standard mode ?1000 250 3100 3325 3400 3513 3550 (slave) (?t sr ) high-speed mode ?300 100 400 625 700 813 850 t sdaho 3t cyc standard mode 0 0 600 375 300 188 150 high-speed mode 0 0 600 375 300 188 150 notes: 1. does not meet the i 2 c bus interface specification. remedial action such as the following is necessary: (a) secure a start/stop condition issuance interval; (b)adjust the rise and fall times by means of a pull-up resistor and capacitive load; (c) reduce the transfer rate; (d) select slave devices whose input timing permits this output timing. the values in the above table will vary depending on the settings of the iicx bit and bits cks0 to cks2.depending on the frequency it may not be possible to achieve the maximum transfer rate; therefore, whether or not the i 2 c bus interface specifications are met must be determined in accordance with the actual setting conditions. 2. calculated using the i 2 c bus specification values (standard mode: 4700 ns min.; high- speed mode: 1300 ns min.).
rev. 2.0, 09/02, page 406 of 658 7. note on icdr read at end of master reception to halt reception after completion of a receive operation in master receive mode, set the trs bit to 1 and write 0 to bbsy and scp in iccr. this changes the sda pin from low to high when the scl pin is high, and generates the stop condition. after this, receive data can be read by means of an icdr read, but if data remains in the buffer the icdrs receive data will not be transferred to icdr, and so it will not be possible to read the second byte of data. if it is necessary to read the second byte of data, issue the stop condition in master receive mode (i.e. with the trs bit cleared to 0). when reading the receive data, first confirm that the bbsy bit in iccr is cleared to 0, the stop condition has been generated, and the bus has been released, then read icdr with trs cleared to 0. note that if the receive data (icdr data) is read in the interval between execution of the instruction for issuance of the stop condition (writing of 0 to bbsy and scp in iccr) and the actual generation of the stop condition, the clock may not be output correctly in subsequent master transmission. clearing of the mst bit after completion of master transmission/reception, or other modifications of iic control bits to change the transmit/receive operating mode or settings, must be carried out during interval (a) in figure 14.17 (after confirming that the bbsy bit has been cleared to 0 in the iccr register). sda scl internal clock bbsy bit master receive mode icdr reading prohibited bit 0 a 8 9 stop condition (a) start condition execution of stop condition issuance instruction (0 written to bbsy and scp) confirmation of stop condition generation (0 read from bbsy) start condition issuance figure 14.17 points for attention concerning reading of master receive data
rev. 2.0, 09/02, page 407 of 658 8. notes on start condition issuance for retransmission depending on the timing combination with the start condition issuance and the subsequently writing data to icdr, it may not be possible to issue the retransmission and the data transmission after retransmission condition issuance. after start condition issuance is done and determined the start condition, write the transmit data to icdr, as shown below. figure 14.18 shows the timing of start condition issuance for retransmission, and the timing for subsequently writing data to icdr, together with the corresponding flowchart.
rev. 2.0, 09/02, page 408 of 658 sda iric scl ack bit 7 data output [3] (restart) start condition instruction issuance [4] iric determination [5] icdr write (next transmit data) [2] detemination of scl = low [1] iric determination start condition (retransmission) iric = 1? yes clear iric in icsr read scl pin write transmit data to icdr write bbsy = 1, scp = 0 (icsr) [1] [1] wait for end of 1-byte transfer [2] determine whether scl0 is low [3] issue restart condition instruction for transmission [4] determine whether start condition is generated or not [5] set transmit data (slave address + r/ ) [2] [3] [4] [5] yes yes no no iric = 1? yes scl = low? start condition issuance? no no other processing note: program so that processing from [3] to [5] is executed continuously. 9 figure 14.18 flowchart and timing of start condition instruction issuance for retransmission
rev. 2.0, 09/02, page 409 of 658 9. notes on i 2 c bus interface stop condition instruction issuance if the rise time of the 9th scl clock exceeds the specification because the bus load capacitance is large, or if there is a slave device of the type that drives scl low to effect a wait, after rising of the 9th scl clock, issue the stop condition after reading scl and determining it to be low, as shown below. stop condition scl iric [1] determination of scl = low 9th clock vih high period secured [2] stop condition instruction isuuance sda as waveform rise is late, scl is detected as low figure 14.19 timing of stop condition issuance 10. notes on initialization of internal state the i 2 c has a function for forcible initialization of its internal state if a deadlock occurs during communication. initialization is executed by (1) setting bits clr3 to clr0 in the ddcswr register. for details see section 14.3.8 ddc switch register (ddcswr). ? scope of initialization: the initialization executed by function covers the following items: ? tdre and rdrf internal flags ? transmit/receive sequencer and internal operating clock counter ? internal latches for retaining the output state of the scl and sda pins (wait, clock, data output, etc.) ? the following items are not initialized: ? actual register values (icdr, sar, sarx, icmr, iccr, icsr, ddcswr, stcr) ? internal latches used t retain register read information setting/clearing flags in the icmr,.iccr, icsr, and ddcswr registers ? the value of the icmr register bit counter (bc2 to bc0) ? generated interrupt sources (interrupt sources transferred to the interrupt controller)
rev. 2.0, 09/02, page 410 of 658 ? notes on initialization: interrupt flags and interrupt sources are not cleared, and so flag clearing measures must be taken as necessary. basically, other register flags are not cleared either, and so flag clearing measures must be taken as necessary. when initialization is executed by the ddcswr register, the write data for bits clr3 to clr0 is not retained. to perform iic clearance, bits clr3 to clr0 must be written to simultaneously using an mov instruction. do not use a bit manipulation instruction such as bclr. similarly, when clearing is required again, all the bits must be written to simultaneously in accordance with the setting. if a flag clearing setting is made during transmission/reception, the iic module will stop transmitting/receiving at that point and the scl and sda pins will be released. when transmission/reception is started again, register initialization, etc., must be carried out as necessary to enable correct communication as a system. the value of the bbsy bit cannot be modified directly by this module clear function, but since the stop condition pin waveform is generated according to the state and release timing of the scl and sda pins, the bbsy bit may be cleared as a result. similarly, state switching of other bits and flags may also have an effect. to prevent problems caused by these factors, the following procedure should be used when initializing the iic state. execute initialization of the internal state according to the setting of bits clr3 to clr0. execute a stop condition issuance instruction (write 0 to bbsy and scp) to clear the bbsy bit to 0, and wait for two transfer rate clock cycles. re-execute initialization of the internal state according to the setting of bits clr3 to clr0. initialize (re-set) the iic registers. 11. interrupt during module stop mode when the module is stopped in the state that an interrupt is requested, the interrupt source of the cpu or activation source of the dtc* is not cleared. be sure to enter module stop mode by disabling the interrupt beforehand. note: * supported only by the h8s/2268 series. 12. assignment and selection of register addresses some i 2 c bus interface registers are assigned to the same address as other registers. register selection is performed by means of the iice bit in the serial control register x (scrx). for details on register addresses, see section 25, list of registers.
rev. 2.0, 09/02, page 411 of 658 section 15 a/d converter this lsi includes a successive approximation type 10-bit a/d converter that allows up to ten analog input channels to be selected. a block diagram of the a/d converter is shown in figure 15.1. 15.1 features ? 10-bit resolution ? ten input channels ? conversion time: 6.3 s per channel (at 20.5 mhz operation) ? two operating modes single mode: single-channel a/d conversion scan mode: continuous a/d conversion on 1 to 4 channels ? four data registers conversion results are held in a 16-bit data register for each channel ? sample and hold function ? three methods conversion start software 16-bit timer pulse unit (tpu or tmr) conversion start trigger external trigger signal ? interrupt request an a/d conversion end interrupt request (adi) can be generated ? module stop mode can be set adcms35b_000020020700
rev. 2.0, 09/02, page 412 of 658 module data bus control circuit internal data bus 10-bit d/a comparator + sample-and- hold circuit adi interrupt bus interface successive approximations register multiplexer a d c s r a d c r a d d r d a d d r c a d d r b a d d r a an0 an1 an2 an3 an4 an5 an6 an7 legend adcr : a/d control register adcsr : a/d control/status register addra : a/d data register a addrb : a/d data register b addrc : a/d data register c addrd : a/d data register d conversion start trigger from tpu or tmr an8 an9 an10 an11 /2 /4 /8 /16 av cc av ss vref figure 15.1 block diagram of a/d converter
rev. 2.0, 09/02, page 413 of 658 15.2 input/output pins table 15.1 summarizes the input pins used by the a/d converter. the eight analog input pins are divided into two groups each of which consists of four channels; analog input pins 0 to 3 (an0 to an3) comprising group 0 and analog input pins 4 to 7 (an4 to an7) comprising group 1. the avcc and avss pins are the power supply pins for the analog block in the a/d converter. the vref pin is the a/d conversion reference voltage pin. table 15.1 pin configuration pin name symbol i/o function analog power supply pin av cc input analog block power supply and reference voltage analog ground pin av ss input analog block ground and reference voltage reference voltage pin vref input reference voltage for a/d conversion analog input pin 0 an0 input analog input pin 1 an1 input analog input pin 2 an2 input analog input pin 3 an3 input group 0 analog input pins analog input pin 4 an4 input analog input pin 5 an5 input analog input pin 6 an6 input analog input pin 7 an7 input group 1 analog input pins analog input pin 8 an8 input analog input pin 9 an9 input analog input pins a/d external trigger input pin adtrg input external trigger input pin for starting a/d conversion
rev. 2.0, 09/02, page 414 of 658 15.3 register descriptions the a/d converter has the following registers. for details on the module stop control register, refer to section 22.1.2, module stop control registers a to d (mstpcra to mstpcrd). ? a/d data register a (addra) ? a/d data register b (addrb) ? a/d data register c (addrc) ? a/d data register d (addrd) ? a/d control/status register (adcsr) ? a/d control register (adcr) 15.3.1 a/d data registers a to d (addra to addrd) there are four 16-bit read-only addr registers; addra to addrd, used to store the results of a/d conversion. the addr registers, which store a conversion result for each channel, are shown in table 15.2. the converted 10-bit data is stored in bits 6 to 15. the lower 6 bits are always read as 0. the data bus between the cpu and the a/d converter is 8 bits wide. the upper byte can be read directly from the cpu, however the lower byte should be read via a temporary register. therefore, when reading the addr, read only the upper byte, or read in word unit. table 15.2 analog input channels and corresponding addr registers analog input channel ch3 = 0 ch3 = 1 group 0 (ch2 = 0) group 1 (ch2 = 1) ? (ch2 = 0) ? (ch2 = 1) a/d data register to be stored the results of a/d conversion an0 an4 setting prohibited setting prohibited addra an1 an5 setting prohibited setting prohibited addrb an2 an6 setting prohibited an8 addrc an3 an7 setting prohibited an9 addrd
rev. 2.0, 09/02, page 415 of 658 15.3.2 a/d control/status register (adcsr) adcsr controls a/d conversion operations. bit bit name initial value r/w description 7adf 0 r/(w) * 1 a/d end flag a status flag that indicates the end of a/d conversion. [setting conditions] ? when a/d conversion ends in single mode ? when a/d conversion ends on all specified channels in scan mode [clearing conditions] ? when 0 is written after reading adf = 1 ? when the dtc is activated by an adi interrupt and addr is read * 2 6 adie 0 r/w a/d interrupt enable a/d conversion end interrupt (adi) request enabled when 1 is set 5 adst 0 r/w a/d start clearing this bit to 0 stops a/d conversion, and the a/d converter enters the wait state. setting this bit to 1 starts a/d conversion. in single mode, this bit is cleared to 0 automatically when conversion on the specified channel is complete. in scan mode, conversion continues sequentially on the specified channels until this bit is cleared to 0 by software, a reset, or a transition to power-down mode in which the a/d converter is halted, shown in table 22.1. the adst bit can be set to 1 by software, a timer conversion start trigger, or the a/d external trigger input pin ( adtrg ).
rev. 2.0, 09/02, page 416 of 658 bit bit name initial value r/w description 4 scan 0 r/w scan mode selects single mode or scan mode as the a/d conversion operating mode. only set the scan bit while conversion is stopped (adst = 0). 0: single mode 1: scan mode 3 2 1 0 ch3 ch2 ch1 ch0 0 0 0 0 r/w r/w r/w r/w channel select 0 to 3 select analog input channels. when scan = 0 when scan = 1 0000: an0 0000: an0 0001: an1 0001: an0 to an1 0010: an2 0010: an0 to an2 0011: an3 0011: an0 to an3 0100: an4 0100: an4 0101: an5 0101: an4 to an5 0110: an6 0110: an4 to an6 0111: an7 0111: an4 to an7 1000: setting prohibited 1000: setting prohibited 1001: setting prohibited 1001: setting prohibited 1010: setting prohibited 1010: setting prohibited 1011: setting prohibited 1011: setting prohibited 1100: setting prohibited 1100: setting prohibited 1101: setting prohibited 1101: setting prohibited 1110: an8 1110: setting prohibited 1111: an9 1111: setting prohibited notes: 1. only 0 can be written to bit 7, to clear this bit. 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 417 of 658 15.3.3 a/d control register (adcr) the adcr enables a/d conversion started by an external trigger signal. bit bit name initial value r/w description 7 6 trgs1 trgs0 0 0 r/w r/w timer trigger select 0 and 1 enables the start of a/d conversion by a trigger signal. only set bits trgs0 and trgs1 while conversion is stopped (adst = 0). 00: a/d conversion start by software is enabled 01: a/d conversion start by tpu conversion start trigger is enabled 10: a/d conversion start by 8-bit timer conversion start trigger is enabled 11: a/d conversion start by external trigger pin ( adtrg ) is enabled 5 4 ? ? 1 1 ? ? reserved these bits are always read as 1 and cannot be modified. 3 2 cks1 cks0 0 0 r/w r/w clock select 0 and 1 these bits specify the a/d conversion time. the conversion time should be changed only when adst = 0. specify a setting that gives a value within the range shown in table 26.9 or 26.22 in section 26, electrical characteristics. 00: conversion time = 530 states (max.) 01: conversion time = 266 states (max.) 10: conversion time = 134 states (max.) 11: conversion time = 68 states (max.) 1, 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
rev. 2.0, 09/02, page 418 of 658 15.4 operation the a/d converter operates by successive approximation with 10-bit resolution. it has two operating modes; single mode and scan mode. when changing the operating mode or analog input channel, in order to prevent incorrect operation, first clear the bit adst to 0 in adcsr. the adst bit can be set at the same time as the operating mode or analog input channel is changed. 15.4.1 single mode in single mode, a/d conversion is to be performed only once on the specified single channel. the operations are as follows. 1. a/d conversion is started when the adst bit is set to 1, according to software, timer conversion start trigger, or external trigger input. 2. when a/d conversion is completed, the result is transferred to the corresponding a/d data register to the channel. 3. on completion of conversion, the adf bit in adcsr is set to 1. if the adie bit is set to 1 at this time, an adi interrupt request is generated. 4. the adst bit remains set to 1 during a/d conversion. when a/d conversion ends, the adst bit is automatically cleared to 0 and the a/d converter enters the wait state.
rev. 2.0, 09/02, page 419 of 658 adie adst adf state of channel 0 (an0) a/d conversion result 2 a/d conversion start a/d conversion result 1 addra addrb addrc addrd state of channel 1 (an1) state of channel 2 (an2) state of channel 3 (an3) note: a/d conversion 1 set * set * set * clear * clear * idle idle idle idle a/d conversion 2 idle read conversion result * read conversion result * vertical arrows indicate instructions executed by software. figure 15.2 example of a/d converter operation (single mode, channel 1 selected) 15.4.2 scan mode in scan mode, a/d conversion is to be performed sequentially on the specified channels (four channels maximum). the operations are as follows. 1. when the adst bit is set to 1 by software, tpu, timer conversion start trigger, or external trigger, input, a/d conversion starts on the first channel in the group (an0 when ch3 and ch2 = 00, an4 when ch3 and ch2 = 01, or an8 when ch3 and ch2 = 10). 2. when a/d conversion for each channel is completed, the result is sequentially transferred to the a/d data register corresponding to each channel. 3. when conversion of all the selected channels is completed, the adf flag is set to 1. if the adie bit is set to 1 at this time, an adi interrupt is requested after a/d conversion ends. conversion of the first channel in the group starts again. 4. steps [2] to [3] are repeated as long as the adst bit remains set to 1. when the adst bit is cleared to 0, a/d conversion stops and the a/d converter enters the wait state.
rev. 2.0, 09/02, page 420 of 658 adst adf addra addrb addrc addrd state of channel 0 (an0) note: contimuous a/d conversion * 2 state of channel 1 (an1) state of channel 3 (an3) state of channel 2 (an2) clear * 1 clear * 1 set * 1 idle idle idle idle idle idle idle idle idle a/d conversion time a/d conversion 1 a/d conversion 2 a/d conversion 4 a/d conversion 3 a/d conversion 5 a/d conversion result 1 a/d conversion result 2 a/d conversion result 2 a/d conversion result 3 1. vertical arrows indicate instructions executed by software. 2. data currently being converted is ignored. figure 15.3 example of a/d converter operation (scan mode, channels an0 to an2 selected) 15.4.3 input sampling and a/d conversion time the a/d converter has a built-in sample-and-hold circuit. the a/d converter samples the analog input when the a/d conversion start delay time (t d ) has passed after the adst bit is set to 1, then starts conversion. figure 15.2 shows the a/d conversion timing. table 15.3 shows the a/d conversion time. as indicated in figure 15.4, the a/d conversion time (t conv ) includes t d and the input sampling time (t spl ). the length of t d varies depending on the timing of the write access to adcsr. the total conversion time therefore varies within the ranges indicated in table 15.3. in scan mode, the values given in table 15.3 apply to the first conversion time. the values given in table 15.4 apply to the second and subsequent conversions.
rev. 2.0, 09/02, page 421 of 658 (1) (2) t d t spl t conv address write signal input sampling timing adf legend (1) : adcsr write cycle (2) : adcsr address t d : a/d conversion start delay t spl : input sampling time t conv : a/d conversion time figure 15.4 a/d conversion timing table 15.3 a/d conversion time (single mode) cks1 = 0 cks1 = 1 cks0 = 0 cks0 = 1 cks0 = 0 cks0 = 1 item symbol min typ max min typ max min typ max min typ max a/d conversion start delay t d 18 ? 33 10 ? 17 6 ? 9 4 ? 5 input sampling time t spl ? 127 ? ? 63 ? ? 31 ? ? 15 ? a/d conversion time t conv 515 ? 530 259 ? 266 131 ? 134 67 ? 68 note: * all values represent the number of states. table 15.4 a/d conversion time (scan mode) cks1 cks0 conversion time (state) 0 512 (fixed) 0 1 256 (fixed) 0 128 (fixed) 1 1 64 (fixed)
rev. 2.0, 09/02, page 422 of 658 15.4.4 external trigger input timing a/d conversion can be externally triggered. when the trgs0 and trgs1 bits are set to 11 in adcr, external trigger input is enabled at the adtrg pin. a falling edge at the adtrg pin sets the adst bit to 1 in adcsr, starting a/d conversion. other operations, in both single and scan modes, are the same as when the bit adst has been set to 1 by software. figure 15.5 shows the timing. internal trigger signal adst a/d conversion figure 15.5 external trigger input timing 15.5 interrupt source the a/d converter generates an a/d conversion end interrupt (adi) at the end of a/d conversion. setting the adie bit to 1 enables adi interrupt requests while the bit adf in adcsr is set to 1 after a/d conversion is completed. in the h8s/2268 series, the dtc* can be activated by an adi interrupt. having the converted data read by the dtc* in response to an adi interrupt enables continuous conversion without imposing a load on software. table 15.5 a/d converter interrupt source name interrupt source interrupt source flag dtc activation * adi a/d conversion completed adf possible note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 423 of 658 15.6 a/d conversion accuracy definitions this lsi's a/d conversion accuracy definitions are given below. ? resolution the number of a/d converter digital output codes ? quantization error the deviation inherent in the a/d converter, given by 1/2 lsb (see figure 15.6). ? offset error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from the minimum voltage value b'0000000000 (h'000) to b'0000000001 (h'001) (see figure 15.7). ? full-scale error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from b'1111111110 (h'3fe) to b'1111111111 (h'3ff) (see figure 15.7). ? nonlinearity error the error with respect to the ideal a/d conversion characteristic between zero voltage and full- scale voltage. does not include offset error, full-scale error, or quantization error (see figure 15.7). ? absolute accuracy the deviation between the digital value and the analog input value. includes offset error, full- scale error, quantization error, and nonlinearity error.
rev. 2.0, 09/02, page 424 of 658 111 110 101 100 011 010 001 000 1 1024 2 1024 1022 1024 1023 1024 fs quantization error digital output ideal a/d conversion characteristic analog input voltage figure 15.6 a/d conversion accuracy definitions (1) fs digital output ideal a/d conversion characteristic nonlinearity error analog input voltage offset error actual a/d conversion characteristic full-scale error figure 15.7 a/d conversion accuracy definitions (2)
rev. 2.0, 09/02, page 425 of 658 15.7 usage notes 15.7.1 module stop mode setting operation of the a/d converter can be disabled or enabled using the module stop control register. the initial setting is for operation of the a/d converter to be halted. register access is enabled by clearing module stop mode. for details, refer to section 22, power-down modes. 15.7.2 permissible signal source impedance this lsi's analog input is designed such that conversion accuracy is guaranteed for an input signal for which the signal source impedance is 5 k ? or less. this specification is provided to enable the a/d converter's sample-and-hold circuit input capacitance to be charged within the sampling time; if the sensor output impedance exceeds 5 k ? , charging may be insufficient and it may not be possible to guarantee a/d conversion accuracy. however, for a/d conversion in single mode with a large capacitance provided externally, the input load will essentially comprise only the internal input resistance of 10 k ? , and the signal source impedance is ignored. however, as a low-pass filter effect is obtained in this case, it may not be possible to follow an analog signal with a large differential coefficient (e.g., 5 mv/ s or greater) (see figure 15.8). when converting a high-speed analog signal, a low-impedance buffer should be inserted. 15.7.3 influences on absolute accuracy adding capacitance results in coupling with gnd, and therefore noise in gnd may adversely affect absolute accuracy. be sure to make the connection to an electrically stable gnd such as avss. care is also required to insure that filter circuits do not communicate with digital signals on the mounting board (i.e., acting as antennas). a/d converter equivalent circuit this lsi 20 pf c in = 15 pf 10 k low-pass filter c to 0.1mf sensor output impedance to 5 k sensor input figure 15.8 example of analog input circuit
rev. 2.0, 09/02, page 426 of 658 15.7.4 range of analog power supply and other pin settings if the conditions below are not met, the reliability of the device may be adversely affected. ? analog input voltage range the voltage applied to analog input pin ann during a/d conversion should be in the range avss ann avcc. ? relationship between avcc, avss and vcc, vss set avss = vss as the relationship between avcc, avss and vcc, vss. if the a/d converter is not used, the avcc and avss pins must not be left open. ? vref range the reference voltage input from the vref pin should be set to avcc or less. 15.7.5 notes on board design in board design, digital circuitry and analog circuitry should be as mutually isolated as possible, and layout in which digital circuit signal lines and analog circuit signal lines cross or are in close proximity should be avoided as far as possible. failure to do so may result in incorrect operation of the analog circuitry due to inductance, adversely affecting a/d conversion values. also, digital circuitry must be isolated from the analog input signals (an0 to an9), and analog power supply (avcc) by the analog ground (avss). also, the analog ground (avss) should be connected at one point to a stable digital ground (vss) on the board. 15.7.6 notes on noise countermeasures a protection circuit should be connected in order to prevent damage due to abnormal voltage, such as an excessive surge at the analog input pins (an0 to an9), between avcc and avss, as shown in figure 15.9. also, the bypass capacitors connected to avcc and the filter capacitor connected to an0 to an9 must be connected to avss. if a filter capacitor is connected, the input currents at the analog input pins (an0 to an9) are averaged, and so an error may arise. also, when a/d conversion is performed frequently, as in scan mode, if the current charged and discharged by the capacitance of the sample-and-hold circuit in the a/d converter exceeds the current input via the input impedance (r in ), an error will arise in the analog input pin voltage. careful consideration is therefore required when deciding circuit constants.
rev. 2.0, 09/02, page 427 of 658 avcc * 1 an0 to an9 avss r in * 2 100 0.1 f 0.01 f 10 f notes: values are reference values. 1. 2. r in : input impedance vref * 1 figure 15.9 example of analog input protection circuit table 15.6 analog pin specifications item min max unit analog input capacitance ? 20 pf permissible signal source impedance ? 5 k ? 20 pf an0 to an9 note: values are reference values. 10 k to a/d converter figure 15.10 analog input pin equivalent circuit
rev. 2.0, 09/02, page 428 of 658
rev. 2.0, 09/02, page 429 of 658 section 16 d/a converter the h8s/2268 series includes a d/a converter, while the h8s/2264 series does not. 16.1 features ? 8-bit resolution ? two output channels ? conversion time: 10 s, maximum (when load capacitance is 20 pf) ? output voltage: 0 v to vref ? d/a output retaining function in software standby mode ? module stop mode can be set module data bus bus interface internal data bus vref avcc da1 da0 avss 8-bit d/a control circuit d a d r 0 d a d r 1 d a c r legend dacr : d/a control register dadr0: d/a data register 0 dadr1: d/a data register 1 figure 16.1 block diagram of d/a converter dac0004b_000020020700
rev. 2.0, 09/02, page 430 of 658 16.2 input/output pins table 16.1 shows the pin configuration for the d/a converter. table 16.1 pin configuration pin name symbol i/o function analog power supply pin av cc input analog block power supply analog ground pin av ss input analog block ground and reference voltage analog output pin 0 da0 output channel 0 analog output pin analog output pin 1 da1 output channel 1 analog output pin reference voltage pin vref input reference voltage for analog block 16.3 register description the d/a converter has the following registers. for details on the module stop control register, refer to section 22.1.2, module stop control registers a to d (mstpcra to mstpcrd). ? d/a data register 0 (dadr0) ? d/a data register 1 (dadr1) ? d/a control register (dacr) 16.3.1 d/a data registers 0 and 1 (dadr0 and dadr1) dadr0 and dadr1 are 8-bit readable/writable registers that store data for d/a conversion. when analog output is permitted, d/a data register contents are converted and output to analog output pins.
rev. 2.0, 09/02, page 431 of 658 16.3.2 d/a control register (dacr) dacr controls d/a converter operation. bit bit name initial value r/w description 7 daoe1 0 r/w d/a output enable 1 controls d/a conversion and analog output 0: analog output da1 is disabled 1: d/a conversion for channel 1 and analog output da1 are enabled 6 daoe0 0 r/w d/a output enable 0 controls d/a conversion and analog output 0: analog output da0 is disabled 1: d/a conversion for channel 0 and analog output da0 are enabled 5 dae 0 r/w d/a enable controls d/a conversion in conjunction with the daoe0 and daoe1 bits. when the dae bit is cleared to 0, d/a conversion for channels 0 and 1 are controlled individually. when dae is set to 1, d/a conversion for channels 0 and 1 are controlled as one. conversion result output is controlled by the daoe0 and daoe1 bits. for details, see table 16.2. 4 to 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
rev. 2.0, 09/02, page 432 of 658 table 16.2 d/a conversion control bit 5 bit 7 bit 6 dae daoe1 daoe0 description 000disables d/a conversion 1 enables d/a conversion for channel 0 1 0 enables d/a conversion for channel 1 1 enables d/a conversion for channels 0 and 1 100disables d/a conversion 1 enables d/a conversion for channels 0 and 1 10 1 16.4 operation two channels of the d/a converter can perform conversion individually. when the daoe bit in dacr is set to 1, d/a conversion is enabled and the conversion results are output. an example of d/a conversion of channel 0 is shown below. the operation timing is shown in figure 16.2. 1. write conversion data to dadr0. 2. when the daoe0 bit in dacr is set to 1, d/a conversion starts. after the interval of t dconv , the conversion results are output from the analog output pin da0. the conversion results are output continuously until dadr0 is modified or daoe0 bit is cleared to 0. the output value is calculated by the following formula: (dadr contents)/256 x vref 3. conversion starts immediately after dadr0 is modified. after the interval of t dconv , conversion results are output. 4. when the daoe bit is cleared to 0, analog output is disabled.
rev. 2.0, 09/02, page 433 of 658 dadr0 write cycle dacr write cycle dadr0 write cycle dacr write cycle adres dadr0 daoe0 da 0 conversion data (1) conversion data (2) high impedance state conversion result (1) conversion result (2) t dconv t dconv legend t dconv: d/a conversion time figure 16.2 d/a converter operation example 16.5 usage notes 16.5.1 analog power supply current in software standby mode if this lsi enters software standby mode while d/a conversion is enabled, d/a output is retained and the analog power supply current is equivalent to that during d/a conversion. to reduce analog power supply current in software standby mode, clear the daoe0, daoe1 and dae bits to 0 to disable d/a output. 16.5.2 setting for module stop mode it is possible to enable/disable the d/a converter operation using the module stop control register, the d/a converter does not operate by the initial value of the register. the register can be accessed by releasing the module stop mode. for more details, see section 22, power-down modes.
rev. 2.0, 09/02, page 434 of 658
rev. 2.0, 09/02, page 435 of 658 section 17 lcd controller/driver the h8s/2268 has an on-chip segment type lcd control circuit, lcd driver, and power supply circuit, enabling it to directly drive an lcd panel. 17.1 overview features of the lcd controller/driver are given below. ? display capacity duty cycle internal driver static 40 seg 1/2 40 seg 1/3 40 seg 1/4 40 seg ? lcd ram capacity 8 bits 20 bytes (160 bits) byte or word access to lcd ram ? the segment output pins can be used as ports. h8s/2268 series: seg40 to seg1 pins can be used as ports in groups of eight. h8s/2264 series: seg24 to seg1 pins can be used as ports in groups of four. ? common output pins not used because of the duty cycle can be used for common double- buffering (parallel connection). with 1/2 duty, parallel connection of com1 to com2, and of com3 to com4, can be used in static mode, parallel connection of com1 to com2, com3, and com4 can be used ? choice of 11 frame frequencies ? a or b waveform selectable by software ? built-in power supply split-resistance ? display possible in operating modes other than standby mode and module stop mode ? display possible during low-voltage operation by built-in triple step-up voltage circuit (supported only by the h8s/2268 series) ? module stop mode as the initial setting, lcd operation is halted. access to registers and lcd ram is enabled by clearing module stop mode. lcdsg00b_000020020700
rev. 2.0, 09/02, page 436 of 658 figure 17.1 shows a block diagram of the lcd controller/driver. /16 to /2048 sub cl2 cl1 segn, do lpcr lcr lcr2 display timing generator lcd ram 20 bytes internal data bus 40-bit shift register lcd drive power supply (built-in step-up voltage circuit * ) segment driver common data latch common driver m v1 v2 v3 v ss com1 com4 seg40 seg39 seg38 seg37 seg36 seg1 legend: lpcr: lcd port control register lcr: lcd control register lcr2: lcd control register 2 note: * supported only by the h8s/2268 series. lpv cc figure 17.1 block diagram of lcd controller/driver
rev. 2.0, 09/02, page 437 of 658 17.2 input/output pins table 17.1 shows the lcd controller/driver pin configuration. table 17.1 pin configuration name abbreviation i/o function segment output pins seg40 to seg1 output lcd segment drive pins (h8s/2268 series) all pins are multiplexed as port pins (setting programmable) (h8s/2264 series) seg24 to seg1 pins are multiplexed as port pins (setting programmable) common output pins com4 to com1 output lcd common drive pins pins can be used in parallel with static or 1/2 duty lcd power supply pins v1, v2, v3 ? used when a bypass capacitor is connected externally, and when an external power supply circuit is used v3 pin is lcd input reference power supply when triple step-up voltage circuit is used * . capacitance pins for lcd step-up voltage * c1, c2 ? capacitance pins for step-up voltage lcd drive power supply note: * supported only by the h8s/2268 series. 17.3 register descriptions the lcd controller/driver has the following registers. ? lcd port control register (lpcr) ? lcd control register (lcr) ? lcd control register 2 (lcr2) ? lcdram
rev. 2.0, 09/02, page 438 of 658 17.3.1 lcd port control register (lpcr) lpcr selects the duty cycle, lcd driver, and pin functions. bit bit name initial value r/w description 7 6 5 dts1 dts0 cmx 0 0 0 r/w r/w r/w duty cycle select 1 and 0 common function select the combination of dts1 and dts0 selects static, 1/2, 1/3, or 1/4 duty. cmx specifies whether or not the same waveform is to be output from multiple pins to increase the common drive power when not all common pins are used because of the duty setting. 4? 0 ? reserved this bit is always read as 0 and should only be written with 0. 3 2 1 0 sgs3 sgs2 sgs1 sgs0 0 0 0 0 r/w r/w r/w r/w segment driver select 3 to 0 bits 3 to 0 select the segment drivers to be used. for details, see tables 17.3 and 17.4.
rev. 2.0, 09/02, page 439 of 658 table 17.2 duty cycle and common function selection bit 7: dts1 bit 6: dts0 bit 5: cmx duty cycle common drivers notes 0 0 0 static com1 com4, com3, and com2 can be used as ports (initial value) 1 com4 to com1 com4, com3, and com2 output the same waveform as com1 1 0 1/2 duty com2 to com1 com4 and com3 can be used as ports 1 com4 to com1 com4 outputs the same waveform as com3, and com2 outputs the same waveform as com1 1 0 0 1/3 duty com3 to com1 com4 can be used as a port * 1 com4 to com1 do not use com4 1 x 1/4 duty com4 to com1 ? legend x: don?t care note: com4 to com1 function as ports when the setting of sgs3 to sgs0 is 0000. * cannot be used as a port when the sups bit in lcr2 is 1 in the h8s/2268 series. set the sups bit to 0 when using as a port. table 17.3 segment driver selection (1) (h8s/2268 series) function of pins seg40 to seg1 bit 3: sgs3 bit 2: sgs2 bit 1: sgs1 bit 0: sgs0 seg40 to seg33 seg32 to seg25 seg24 to seg17 seg16 to seg9 seg8 to seg1 0 0 0 0 port port port port port 1 seg port port port port 1 0 seg seg port port port 1 seg seg seg port port 1 0 0 seg seg seg seg port 1 seg seg seg seg seg 1 x setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited 1 x x x setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited legend x: don?t care note: * com4 to com1 also function as ports when the setting of sgs3 to sgs0 is 0000.
rev. 2.0, 09/02, page 440 of 658 table 17.4 segment driver selection (2) (h8s/2264 series) function of pins seg40 to seg1 bit 3: sgs3 bit 2: sgs2 bit 1: sgs1 bit 0: sgs0 seg40 to seg25 seg24 to seg21 seg20 to seg17 seg16 to seg13 seg12 to seg9 seg8 to seg5 seg4 to seg1 0 0 0 0 ? port port port port port port 1 setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited 1 0 seg port port port port port port 1 seg seg seg port port port port 1 0 0 seg seg seg seg seg port port 1 seg seg seg seg seg seg seg 1x setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited 100x setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited 1 0 seg seg port port port port port 1 seg seg seg seg port port port 1 0 0 seg seg seg seg seg seg port 1 setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited 1x setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited setting prohibited legend x: don?t care note: * com4 to com1 also function as ports when the setting of sgs3 to sgs0 is 0000.
rev. 2.0, 09/02, page 441 of 658 17.3.2 lcd control register (lcr) lcr performs lcd power supply split-resistance connection control and display data control, and selects the frame frequency. bit bit name initial value r/w description 7 ? 1 r/w lcd disable bit this bit is always read as 1. the write value should always be 0. 6 psw 0 r/w lcd power supply split-resistance connection control bit 6 can be used to disconnect the lcd power supply split-resistance from v cc when lcd display is not required in a power-down mode, or when an external power supply is used. when the act bit is cleared to 0, and also in standby mode, the lcd power supply split-resistance is disconnected from v cc regardless of the setting of this bit. 0: lcd power supply split-resistance is disconnected from v cc 1: lcd power supply split-resistance is connected to v cc 5 act 0 r/w display function activate bit 5 specifies whether or not the lcd controller/driver is used. clearing this bit to 0 halts operation of the lcd controller/driver. the lcd drive power supply ladder resistance is also turned off, regardless of the setting of the psw bit. however, register contents are retained. 0: lcd controller/driver operation halted 1: lcd controller/driver operation enabled 4 disp 0 r/w display data control bit 4 specifies whether the lcd ram contents are displayed or blank data is displayed regardless of the lcd ram contents. 0: blank data is displayed 1: lcd ram data is displayed
rev. 2.0, 09/02, page 442 of 658 bit bit name initial value r/w description 3 2 1 0 cks3 cks2 cks1 cks0 0 0 0 0 r/w r/w r/w r/w frame frequency select 3 to 0 bits 3 to 0 select the operating clock and the frame frequency. in subactive mode, watch mode, and subsleep mode, the system clock ( ) is halted, and therefore display operations are not performed if one of the clocks from /16 to /2048 is selected. if lcd display is required in these modes, sub , sub /2, or sub /4 must be selected as the operating clock. for details, see table 17.5. note: * 0 should be written to bit 7 after the other bits have been set. table 17.5 frame frequency selection bit 3: bit 2: bit 1: bit 0: frame frequency * 1 cks3 cks2 cks1 cks0 operating clock = 20 mhz = 2 mhz 0x00 sub 128 hz* 2 128 hz * 2 1 sub /2 64 hz* 2 64 hz * 2 1x sub /4 32 hz* 2 32 hz * 2 1000 /16 ? 488 hz 1 /32 ? 244 hz 10 /64 ? 122 hz 1 /128 610 hz 61 hz 100 /256 305 hz 30.5 hz 1 /512 152.6 hz ? 10 /1024 76.3 hz ? 1 /2048 38.1 hz ? legend x: don?t care notes: 1. when 1/3 duty is selected, the frame frequency is 4/3 times the value shown. 2. this is the frame frequency when sub = 32.768 khz. 17.3.3 lcd control register 2 (lcr2) lcr2 controls switching between the a waveform and b waveform, selects clock for step-up voltage circuit, selects power supply, and selects the duty ratio for charge/discharge pulse that controls to separate power supply divider resistance from power supply circuit.
rev. 2.0, 09/02, page 443 of 658 bit bit name initial value r/w description 7 lcdab 0 r/w a waveform/b waveform switching control bit 7 specifies whether the a waveform or b waveform is used as the lcd drive waveform. 0: drive using a waveform 1: drive using b waveform 6? 1 ? reserved these bits are always read as 1 and cannot be modified. 5 hcks 0 r/w (h8s/2268 series) triple step-up voltage circuit clock select this bit selects a clock used for triple step-up voltage circuit. this bit selects a clock which divides a clock specified by the lcd operating control register (lcr) by 4 or 8 as step-up voltage circuit clock. 0: a clock, which divides a lcd operating clock by 4, is selected as step-up voltage circuit clock 1: a clock, which divides a lcd operating clock by 8, is selected as step-up voltage circuit clock (h8s/2264 series) reserved 0 should be written to this bit. 4 sups 0 r/w (h8s/2268 series) drive power select triple step-up voltage circuit control the triple step-up voltage circuit stops operation when vcc is selected as drive power. the triple step-up voltage circuit starts operation when lcd input reference voltage (v lcd3 ) is selected as drive power. 0: drive power is vcc, triple step-up voltage circuit halts 1: drive power is triple step-up voltage of the lcd input reference voltage (v lcd3 ), triple step-up voltage circuit operates (h8s/2264 series) reserved 0 should be written to this bit.
rev. 2.0, 09/02, page 444 of 658 bit bit name initial value r/w description 3 2 1 0 cds3 cds2 cds1 cds0 0 0 0 0 r/w r/w r/w r/w selection of duty ratio for charge/discharge pulse duty ratio is selected during the power supply divider resistance is connected to power supply circuit. when the duty ratio of 0 is selected, the power supply divider resistance is fixed to the state that the resistance is separated from the power supply circuit. therefore, supply the power to pins v 1 , v 2 , and v 3 from the external circuit. the charge/discharge pulses have the waveform shown in figure 17.2. the duty ratio is represented by t c /t w . 0000: duty ratio = 1 (stack at high) 0001: duty ratio = 1/8 0010: duty ratio = 2/8 0011: duty ratio = 3/8 0100: duty ratio = 4/8 0101: duty ratio = 5/8 0110: duty ratio = 6/8 0111: duty ratio = 0 (stack at low) 10xx: duty ratio = 1/16 11xx: duty ratio = 1/32 legend x: don?t care com1 tc tdc t w 1 tc tdc figure 17.2 a waveform 1/2 duty 1/2 vias
rev. 2.0, 09/02, page 445 of 658 the relationships between the lcd operating clock and step-up voltage clock, and between bits cks3 to cks0 in lcd control register (lcr) and bit hcks in lcd control register 2 (lcr2) are shown below. lcr bit 3 bit 2 bit 1 bit 0 frame frequency step-up voltage circuit clock frequency * cks3 cks2 cks1 cks0 lcr2 bit 5 hcks * lcd clock step-up voltage circuit clock * = 20 mhz = 2 mhz = 20 mhz = 2 mhz 0 sub /4 8192 hz 0x00 1 sub 128 hz 0 sub /8 4096 hz 0x01 1 sub /2 64 hz 0 sub /16 2048 hz 0x1x 1 sub /4 sub /32 32 hz 1024 hz 0 64 ? 31.3 khz 1000 1 /16 ? 488 hz 0 128 ? 15.6 khz 1001 1 /32 ? 244 hz 0 256 ? 7.81 khz 1010 1 /64 ? 122 hz ? 0 512 39.1 khz 3.91 khz 1011 1 /128 610 hz 61 hz 0 1024 19.5 khz 1.95 khz 1100 1 /256 305 hz 30.5 hz 977 khz 0 2048 9.77 khz ? 1101 1 /512 152.6 hz ? 0 4096 4.88 khz ? 1110 1 /1024 76.3 hz ? 0 8192 2.44 khz ? 1111 1 /2048 16384 38.1 hz ? 1.22 khz ? legend x: don?t care note: * supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 446 of 658 17.4 operation 17.4.1 settings up to lcd display to perform lcd display, the hardware and software related items described below must first be determined. 1. hardware settings a. using 1/2 duty when 1/2 duty is used, interconnect pins v 2 and v 3 as shown in figure 17.3. v1 v2 v3 v cc v ss figure 17.3 handling of lcd drive power supply when using 1/2 duty b. large-panel display as the impedance of the built-in power supply split-resistance is large, it may not be suitable for driving a large panel. if the display lacks sharpness when using a large panel, refer to section 17.4.6, boosting the lcd drive power supply. when static or 1/2 duty is selected, the common output drive capability can be increased. set cmx to 1 when selecting the duty cycle. in this mode, with a static duty cycle pins com4 to com1 output the same waveform, and with 1/2 duty the com1 waveform is output from pins com2 and com1, and the com2 waveform is output from pins com4 and com3. c. lcd drive power supply setting with the h8s/2268 and 2264, there are two ways of providing lcd power: by using the on-chip power supply circuit, or by using an external power supply circuit. when an external power supply circuit is used for the lcd drive power supply, connect the external power supply to the v1 pin. 2. software settings a. duty selection any of four duty cycles?static, 1/2 duty, 1/3 duty, or 1/4 duty?can be selected with bits dts1 and dts0.
rev. 2.0, 09/02, page 447 of 658 b. segment selection the segment drivers to be used can be selected with bits sgs3 to sgs0. 3. frame frequency selection the frame frequency can be selected by setting bits cks3 to cks0. the frame frequency should be selected in accordance with the lcd panel specification. for the clock selection method in watch mode, subactive mode, and subsleep mode, see section 17.4.4, operation in power-down modes. a. a or b waveform selection either the a or b waveform can be selected as the lcd waveform to be used by means of lcdab. b. lcd drive power supply selection when an external power supply circuit is used, turn the lcd drive power supply off with the psw bit. 17.4.2 relationship between lcd ram and display the relationship between the lcd ram and the display segments differs according to the duty cycle. lcd ram maps for the different duty cycles are shown in figures 17.4 to 17.7. after setting the registers required for display, data is written to the part corresponding to the duty using the same kind of instruction as for ordinary ram, and display is started automatically when turned on. word- or byte-access instructions can be used for ram setting. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 seg40 h'fc53 h'fc40 seg40 seg40 seg40 seg39 seg39 seg39 seg39 seg2 seg2 seg2 seg2 seg1 seg1 seg1 seg1 com4 com3 com2 com1 com4 com3 com2 com1 figure 17.4 lcd ram map (1/4 duty)
rev. 2.0, 09/02, page 448 of 658 h'fc53 h'fc40 seg40 seg40 seg40 seg39 seg39 seg39 seg2 seg2 seg2 seg1 seg1 seg1 com3 space not used for display com2 com1 com3 com2 com1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 figure 17.5 lcd ram map (1/3 duty) h'fc53 h'fc40 h'fc49 seg40 seg40 seg39 seg39 seg38 seg38 seg37 seg37 seg4 seg4 seg3 seg3 seg2 seg2 seg1 seg1 display space space not used for display com2 com1 com2 com1 com2 com1 com2 com1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 figure 17.6 lcd ram map (1/2 duty)
rev. 2.0, 09/02, page 449 of 658 h'fc53 h'fc40 h'fc44 seg40 seg39 seg38 seg37 seg36 seg35 seg34 seg33 display space space not used for display seg8 seg7 seg6 seg5 seg4 seg3 seg2 seg1 com1 com1 com1 com1 com1 com1 com1 com1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 figure 17.7 lcd ram map (static mode)
rev. 2.0, 09/02, page 450 of 658 m data (a) waveform with 1/4 duty (c) waveform with 1/2 duty (d) waveform with static output (b) waveform with 1/3 duty com1 com2 com3 com4 segn m data com1 com2 segn m data com1 segn m data 1 frame 1 frame 1 frame 1 frame com1 v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2,v3 vss v1 vss v1 vss v1 v2,v3 vss v1 v2,v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v1 v2 v3 vss v2 v3 vss com2 com3 segn figure 17.8 output waveforms for each duty cycle (a waveform)
rev. 2.0, 09/02, page 451 of 658 m data (a) waveform with 1/4 duty (c) waveform with 1/2 duty (d) waveform with static output (b) waveform with 1/3 duty com1 com2 com3 com4 segn m data com1 com2 segn m data com1 segn m data 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame 1 frame com1 v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v2,v3 vss v1 vss v1 vss v1 v2,v3 vss v1 v2,v3 vss v1 v2 v3 vss v1 v2 v3 vss v1 v1 v2 v3 vss v2 v3 vss com2 com3 segn figure 17.9 output waveforms for each duty cycle (b waveform)
rev. 2.0, 09/02, page 452 of 658 table 17.6 output levels data 0011 m 0101 static common output v1 v ss v1 v ss segment output v1 v ss v ss v1 1/2 duty common output v2, v3 v2, v3 v1 v ss segment output v1 v ss v ss v1 1/3 duty common output v3 v2 v1 v ss segment output v2 v3 v ss v1 1/4 duty common output v3 v2 v1 v ss segment output v2 v3 v ss v1 17.4.3 triple step-up voltage circuit (supported only by the h8s/2268 series) the h8s/2268 series incorporates a triple step-up voltage circuit. triple voltage of liquid crystal input reference voltage (v lcd3 ) input from v3 pin can be used for the lcd driver. before enabling the step-up voltage circuit, duty cycle (1/3 duty or 1/4 duty), lcd driver or i/o pin function, and display data and frame frequency should be selected. around 0.1-f capacitor should be connected between c1 and c2, and voltage specified in section 26.2.6, lcd characteristics should be applied to v3 pin. after above settings, by selecting the step-up voltage circuit clock in lcd control register 2 (lcr2) and setting sups to 1, the triple step-up voltage circuit operates, voltage double of v lcd3 is generated for v2 pin, and voltage triple of v lcd3 is generated for v1pin. notes: 1. the triple step-up voltage circuit should only be used as lcd drive power of the h8s/2268 series. to drive large panel, power supply capacitance may be insufficient. in this case, vcc should be used as power supply or external power supply circuit should be used. 2. when the triple step-up voltage circuit is used, do not specify static or 1/2 duty as duty cycle. 3. do not use capacitance with polarity such as electrolytic capacitor as capacitance to be connected between c1 and c2.
rev. 2.0, 09/02, page 453 of 658 c1 c c c c note: c: 0.1 f (typ.) (0.05 to 0.2 f) c2 v1 v2 v3 figure 17.10 connection when triple step-up voltage circuit used (supported only by the h8s/2268 series) 17.4.4 operation in power-down modes in the h8s/2268 and 2264, the lcd controller/driver can be operated even in the power-down modes. the operating state of the lcd controller/driver in the power-down modes is summarized in table 17.7. in subactive mode, watch mode, and subsleep mode, the system clock oscillator stops, and therefore, unless sub , sub /2, or sub /4 has been selected by bits cks3 to cks0, the clock will not be supplied and display will halt. since there is a possibility that a direct current will be applied to the lcd panel in this case, it is essential to ensure that sub , sub /2, or sub /4 is selected. in the software standby mode the segment output and common output pins switch to i/o port status. in this case if a port?s ddr or pcr bit is set to 1, a dc voltage could be applied to the lcd panel. therefore, ddr and pcr must never be set to 1 for ports being used for segment output or common output.
rev. 2.0, 09/02, page 454 of 658 table 17.7 power-down modes and display operation mode reset active sleep watch subactive subsleep software standby hardware standby module stop clock runs runs runs stops stops stops stops stops stops * 4 w runs runs runs runs runs runs stops * 1 stops stops * 4 display act = 0 stops stops stops stops stops stops stops * 2 stops * 2 stops operation act = 1 stops functions functions functions * 3 functions * 3 functions * 3 stops * 2 stops * 2 stops notes: 1. the subclock oscillator does not stop, but clock supply is halted. 2. the lcd drive power supply is turned off regardless of the setting of the psw bit. 3. display operation is performed only if sub , sub /2, or sub /4 is selected as the operating clock. 4. the clock supplied to the lcd stops. 17.4.5 low-power lcd drive the simplest way to achieve low-power operation for an lcd power supply circuit is to use an internal division resistor. however, since the values of the internal resistors are fixed, a constant current continually flows from vcc to vss of the internal resistor. since the quantity of the current is independent of the dissipation current of an lcd panel, power is wasted in using a low-power lcd. this lsi incorporates a function that eliminates wastage of power. by using this function, a power supply circuit that is most suitable for the power of a given lcd panel can be obtained. ? principle ? as shown in figure 17.11, external capacitors are connected to v1, v2, and v3 of the lcd power supply terminals. ? the capacitors connected to v1, v2, and v3 are repeatedly charged and discharged to retain required voltage levels in the cycles shown in figure 17.11. ? in this case, the charged voltages are equivalent to v1, v2, and v3, respectively. (in 1/3 bias operation, for example, the v2 voltage is two thirds of the v1 voltage and the v3 voltage is one third of the v1 voltage.) ? power is supplied to the lcd panel by the electric charges that are accumulated in these capacitors. ? the capacitances of the capacitors and the charge-discharge period are determined by the quantity of power which the lcd panel requires. ? the charge-discharge period can be determined by software. ? example of operation (1/3 bias operation)
rev. 2.0, 09/02, page 455 of 658 ? during charging period tc in figure 17.11, the voltages that are divided by the internal division resistors are applied to the v1, v2, and v3 terminals (the v2 voltage is two thirds of the v1 voltage and the v3 voltage is one third of the v1 voltage), and these voltages charge external capacitors c1, c2, and c3. even during this period, the lcd panel is being driven. ? in the subsequent discharge period tdc, the charge operation stops. the lcd panel is now driven by discharge of the charges accumulated in the respective capacitors. ? at this point in time, the respective voltages fall slightly as the capacitors are discharged. attention must be paid so that the operation of the lcd panel is not affected, by selecting the proper charging period and the capacitance of the capacitors. ? the capacitors connected to the v1, v2, and v3 terminals are repeatedly charged and discharged in the cycles shown in figure 17.11 and retain required voltages, keeping the lcd panel in operation. ? the capacitance of the capacitors and a charge-discharge period is determined by the quantity of power in which the lcd panel requires. in addition, the charge-discharge period can be selected by cds3 to 0. ? in actuality, the capacitance of the capacitors and the charge-discharge period must be determined through experiment, on the basis of the power dissipation specifications of the lcd panel. this method, however, permits the most proper current value to be selected, compared with a case in which a dc current continually flows in the internal resistors. v1 v2 v3 c3 c2 c1 v1 potential v2 potential v3 potential charging period tc discharging period tdc vd1 vd2 vd3 voltage drop associated with discharging due to lcd panel driving v1x2/3 v1x1/3 power supply voltage fluctuation in 1/3 bias system figure 17.11 example of low-power-consumption lcd drive operation 17.4.6 boosting the lcd drive power supply when a large panel is driven, the on-chip power supply capacity may be insufficient. in this case, the power supply impedance must be reduced. this can be done by connecting bypass capacitors of around 0.1 to 0.3 f to pins v1 to v3, as shown in figure 17.12, or by adding a split-resistance externally.
rev. 2.0, 09/02, page 456 of 658 this lsi v cc v ss v1 v2 v3 vr r r r r = c = 0.1 to 0.3 f several k ? to several m ? figure 17.12 connection of external split-resistance
rev. 2.0, 09/02, page 457 of 658 section 18 dtmf generation circuit the h8s/2268 series contains a dual-tone multi-frequency generation circuit to generate dtmf signals. it is not contained in the h8s/2264 series. the dtmf signal consists of two types of sine waveforms and is used to access a switch device. the function of the dtmf signal is shown in the frequency matrix in figure 18.1. the dtmf generation circuit produces the frequencies corresponding to the numbers and symbols in the figure. 1 2 3 a r1(697hz) r2(770hz) r3(852hz) r4(941hz) c1(1,209hz) c2(1,336hz) c3(1,477hz) c4(1,633hz) 45 6b 78 9c * 0#d figure 18.1 dtmf frequencies 18.1 features ? generating dtmf frequency sine waveform from the system clock ( ) the system clock (2.0 to 20.4 mhz, with 400 khz stops) is divided to produce a 400-khz clock signal. this clock signal is then supplied to the feedback loop, comprised of a variant program divider and sine waveform counter to generate a dtmf frequency sine waveform. ? producing low distortion, stable sine waveforms sine waveforms signals are output from the high-precision resistor rudder-type d/a converter. in addition, one cycle is divided into 32, resulting in low-distortion stable signal waveforms. ? synthesis or single waveform output selectable synthesized row and column output, row output, or column output are selectable. ? module stop mode can be set. figure 18.2 shows the block diagram for the dtmf generation circuit. dtmf000b_000020020700
rev. 2.0, 09/02, page 458 of 658 clock counter (2.0 to 20.4mhz, with 400khz steps) 400khz dtlr sine waveform counterd/a toned av cc variant program divider sine waveform counter d/a variant progam divider feed back feedback symbol explanationl dtlr : dtmf load register dtcr : dtmf control register internal data bus dtcr column row figure 18.2 dtmf generation circuit diagram 18.2 input/output pins table 18.1 shows the pin configuration of the dtmf generation circuit. table 18.1 pin configuration name abbreviation input/output function analog power supply pin avcc input power supply of analog section dtmf signal output toned output dtmf signal output pin 18.3 register descriptions the dtmf generation circuit contains the following resisters: ? dtmf control register (dtcr) ? dtmf load register (dtlr)
rev. 2.0, 09/02, page 459 of 658 18.3.1 dtmf control register (dtcr) the dtcr controls the dtmf generation circuit operation, column and row outputs, and selects the output frequency. bit bit name initial value r/w description 7 dten 0 r/w this bit controls dtmf generation 0: halts the dtmf generation circuit. 1: operates dtmf generation circuit. 6 ? 1 ? reserved this bit is always read as 1 and cannot be modified. 5 cloe 0 r/w this bit controls column section outputs 0: inhibits dtmf signal output on column section (hi-impedance) 1: enables dtmf signal output on column section. 4 rwoe 0 r/w this bit controls column section outputs 0: inhibits dtmf signal output on row section (hi- impedance) 1: enables dtmf signal output on row section. 3 2 clf1 clf0 0 0 r/w r/w dtmf signal output frequency on column section 1 and 0 selects column dtmf signal frequency from c1 to c4. 00: column dtmf signal output frequency: 1209 hz (c1) 01: column dtmf signal output frequency: 1336 hz (c2) 10: column dtmf signal output frequency: 1447 hz (c3) 11: column dtmf signal output frequency: 1633 hz (c4)
rev. 2.0, 09/02, page 460 of 658 bit bit name initial value r/w description 1 0 rwf1 rwf0 0 0 r/w r/w dtmf signal output frequency on row section: 1, 0 selects column dtmf signal frequency from r1 to r4. 00: row dtmf signal output frequency: 697 hz (r1) 01: row dtmf signal output frequency: 770 hz (r2) 10: row dtmf signal output frequen#y: 852 hz (r3) 11: row dtmf signal output frequency: 941 hz (r4) 18.3.2 dtmf load register (dtlr) the dtlr sets the system clock division ratio for the dtmf generation circuit.
rev. 2.0, 09/02, page 461 of 658 bit bit name initial value r/w description 7 to 6 ? 1 ? reserved this bit is always read as 1 and cannot be modified. 5 4 3 2 1 0 dtl5 dtl4 dtl3 dtl2 dtl1 dtl0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w main clock division ratio 5 to 0 these bits set the system clock division ratio to produce 400-khz clock signals to be supplied to the dtmf generation circuit. the division ratio determines the counter value of 6b'000101 to 6b'110011(d'5 to d'51) according to the range 2.0 to 20.4 mhz. 000000: setting prohibited 000001: setting prohibited 000010: setting prohibited 000011: setting prohibited 000100: setting prohibited 000101: division ratio (5) main clock frequency (2.0 mhz) 000110: division ratio (6) main clock frequency (2.4 mhz) 000111: division ratio (7) main clock frequency (2.8 mhz) : : 110001: division ratio (49) main clock frequency (19.6 mhz) 110010: division ratio (50) main clock frequency (20.0 mhz) 110011: division ratio (51) main clock frequency (20.4 mhz) 110100: setting prohibited : : 111111: setting prohibited note: the correct values should be set in dtl0 to dtl5. if these bit settings do not match the system clock, correct dtmf signal output frequency cannot be obtained. additionally, correct operation is not guaranteed if the dtl0 to dtl5 settings are other than 5 to 51 (division ratio 5 to 51).
rev. 2.0, 09/02, page 462 of 658 18.4 operation 18.4.1 output waveform the dtmf generation circuit provides synthesized row and column groups output waveforms or sine waveforms (dtcr signal) of row or column group from toned pin. these signals are produced in the high-precision resistor rudder-type d/a converter. the output frequency is set in dtcr. figure 18.3 shows the toned pin output equivalent circuit. figure 18.4 shows a single output waveform of column or row group alone. one cycle of the output waveform is divided into 32, resulting in low-distortion stable signal waveforms. control output control row column av cc av ss toned figure 18.3 toned pin output equivalent circuit time slot av cc av ss 12345678910111213141516171819202122232425 303132 26272829 figure 18.4 toned pin output waveform (row or column group alone) table 18.2 shows dtmf generation circuit output signal and typical signal frequencies, and frequency deviation between the two.
rev. 2.0, 09/02, page 463 of 658 table 18.2 frequency deviation between dtmf output signals and typical signals symbol typical signal (hz) dtmf signal output (hz) frequency deviation (%) r1 697 694.44 ? 0.37 r2 770 769.23 ? 0.10 r3 852 851.06 ? 0.11 r4 941 938.97 ? 0.22 c1 1209 1212.12 0.26 c2 1336 1333.33 ? 0.20 c3 1477 1481.48 0.30 c4 1633 1639.34 0.39 18.4.2 operation flow the operating procedure for the dtmf generation circuit is as follows: 1. set the system clock division ratio for the dtlr based on the frequency of the connected system clock. (2.0 to 20.4 mhz, with 400 khz stops) 2. set the frequencies of the row (r1 to r4) and column (c1 to c4) sections based on clf0, clf1, rwf0 and rwf1 of the dtcr. 3. select the outputs of the row and column based on cloe and rwoe of the dtcr, and set dten to 1 to operate the dtmf generation circuit. with the above setting, the set dtmf signal is output from the toned pin.
rev. 2.0, 09/02, page 464 of 658 18.5 application circuit example an application example of the dtmf generation circuit is shown in figure 18.5. toned av cc lsi pxx dtmf v ref 1 ha16808ant mute 2sc458 19 2k 24k 100k 360k +0.47 20 11 note: the numeriic values on the right end of the signal lines indicate the ha16808ant pin numbers. figure 18.5 example of ha16808ant connection 18.6 usage notes 1. setting the module stop mode it is possible to enable/disable the dtmf operation using the module stop control register. the dtmf does not operate by the initial value of the register. the register can be accessed by releasing the module stop mode. for more details, see section 22, power-down modes. 2. dtlr setting and system clock when using the dtmf generation circuit, note the following: the dtlr must be set so as to accommodate the system clock. if the dtlr setting does not match the system clock, correct dtmf signal output frequency cannot be obtained. 3. relationship between avcc, avss and vcc, vss set avss = vss as the relationship between avcc, avss and vcc, vss. if the dtmf generation circuit is not used, the avcc and avss pins must not be left open. note: if the conditions above are not met, the reliability of the device may be adversely affected.
rev. 2.0, 09/02, page 465 of 658 section 19 ram in the h8s/2268 series, the h8s/2268 has 16 kbytes of on-chip high-speed static ram, the h8s/2266 has 8 kbytes of on-chip high-speed static ram, and the h8s/2265 has 4 kbytes of on- chip high-speed static ram. in the h8s/2264 series, the h8s/2264 and h8s/2264r have 4 kbytes of on-chip high-speed static ram, and the h8s/2262 and h8s/2262r have 2 kbytes of on-chip high-speed static ram. the ram is connected to the cpu by a 16-bit data bus, enabling one- state access by the cpu to both byte data and word data.
rev. 2.0, 09/02, page 466 of 658
rev. 2.0, 09/02, page 467 of 658 section 20 rom the features of the flash memory are summarized below. the block diagram of the flash memory is shown in figure 20.1. 20.1 features ? capacity h8s/2268 series: 256 kbytes (h8s/2268) 128 kbytes (h8s/2266, h8s/2265) h8s/2264 series: 128 kbytes (h8s/2264, h8s/2264r) ? programming/erase methods the flash memory is programmed 128 bytes at a time. erase is performed in single-block units. the flash memory of the h8s/2268 is configured as follows: 64 kbytes 3 blocks, 32 kbytes 1 block, and 4 kbytes 8 blocks. the flash memory of the h8s/2266 and h8s/2265 is configured as follows: 64 kbytes 1 block, 32 kbytes 1 block, and 4 kbytes 8 blocks. the flash memory of the h8s/2264 and h8s/2264r is configured as follows: 32 kbytes 2 blocks, 28 kbytes 1 block, 16 kbytes 1 block, 8 kbytes 2 blocks, and 1 kbyte 4 blocks. to erase the entire flash memory, each block must be erased in turn. ? reprogramming capability the flash memory can be reprogrammed for 100 times. ? two programming modes boot mode user program mode on-board programming/erasing can be done in boot mode, in which the boot program built into the chip is started to erase or program of the entire flash memory. in normal user program mode, individual blocks can be erased or programmed. ? automatic bit rate adjustment for data transfer in boot mode, this lsi's bit rate can be automatically adjusted to match the transfer bit rate of the host. ? programming/erasing protection there are three protect modes, hardware, software, and error protect, which allow protected status to be designated for flash memory program/erase operations. ? programmer mode flash memory can be programmed/erased in programmer mode using a prom programmer, as well as in on-board programming mode. ? emulation function for flash memory in ram romf253b_000020020700
rev. 2.0, 09/02, page 468 of 658 the real-time emulation for programming of flash memory is possible by overlapping the flash memory to a part of ram. module bus bus interface/controller flash memory (256 kbytes * ) operating mode flmcr2 internal address bus internal data bus (16 bits) fwe pin mode pin ebr1 ebr2 ramer flmcr1 flash memory control register 1 flash memory control register 2 erase block register 1 erase block register 2 ram emulation register legend flmcr1: flmcr2: ebr1: ebr2: ramer: flpwcr: flash memory power control register note: * the flash memory of the h8s/2266, h8s/2265, h8s/2264, and h8s/2264r is 128 kbytes. flpwcr figure 20.1 block diagram of flash memory 20.2 mode transitions when the mode pins and the fwe pin are set in the reset state and a reset-start is executed, this lsi enters an operating mode as shown in figure 20.2. in user mode, flash memory can be read but not programmed or erased. the boot, user program and programmer modes are provided as modes to write and erase the flash memory. the differences between boot mode and user program mode are shown in table 20.1. figure 20.3 shows the operation flow for boot mode and figure 20.4 shows that for user program mode.
rev. 2.0, 09/02, page 469 of 658 boot mode on-board programming mode user program mode user mode reset state programmer mode = 0 fwe = 1 fwe = 0 * 1 * 1 * 2 notes: only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. 1. ram emulation possible 2. md1 = 0, md2 = 0, p14 = 0, p16 = 0, p70 = 1 3. in the h8s/2264 series, reset state should be cancelled when the p76 pin is driven high by pulling the pin up on the board. = 0 md1 = 0 md2 = 1, fwe = 1 = 0 = 0 md1 = 1, md2 = 1, fwe = 0 md1 = 1, md2 = 1, fwe = 1 * 3 figure 20.2 flash memory state transitions table 20.1 differences between boot mode and user program mode boot mode user program mode total erase yes yes block erase no yes programming control program * program/program-verify program/program-verify/erase/ erase-verify/emulation note: * to be provided by the user, in accordance with the recommended algorithm.
rev. 2.0, 09/02, page 470 of 658 flash memory this lsi ram host programming control program sci application program (old version) new application program flash memory this lsi ram host sci application program (old version) boot program area new application program flash memory this lsi ram host sci flash memory preprogramming erase boot program new application program flash memory this lsi program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in this lsi (originally incorporated in the chip) is started and the programming control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, total flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. programming control program boot program boot program boot program area boot program area programming control program figure 20.3 boot mode
rev. 2.0, 09/02, page 471 of 658 flash memory this lsi ram host programming/ erase control program sci boot program new application program flash memory this lsi ram host sci new application program flash memory this lsi ram host sci flash memory erase boot program new application program flash memory this lsi program execution state ram host sci boot program boot program fwe assessment program application program (old version) new application program 1. initial state the fwe assessment program that confirms that user program mode has been entered, and the program that will transfer the programming/erase control program from flash memory to on-chip ram should be written into the flash memory by the user beforehand. the programming/erase control program should be prepared in the host or in the flash memory. 2. programming/erase control program transfer when user program mode is entered, user software confirms this fact, executes transfer program in the flash memory, and transfers the programming/erase control program to ram. 3. flash memory initialization the programming/erase program in ram is executed, and the flash memory is initialized (to h'ff). erasing can be performed in block units, but not in byte units. 4. writing new application program next, the new application program in the host is written into the erased flash memory blocks. do not write to unerased blocks. programming/ erase control program programming/ erase control program programming/ erase control program transfer program application program (old version) transfer program fwe assessment program fwe assessment program transfer program fwe assessment program transfer program figure 20.4 user program mode (example)
rev. 2.0, 09/02, page 472 of 658 20.3 block configuration figure 20.5 shows the block configuration of 256-kbyte flash memory of the h8s/2268. figure 20.6 shows the block configuration of 128-kbyte flash memory of the h8s/2266 and h8s/2265. figure 20.7 shows the block configuration of 128-kbyte flash memory of the h8s/2264 and h8s/2264r. the thick lines indicate erasing units, the narrow lines indicate programming units, and the values are addresses. the flash memory of the h8s/2268 is divided into 4 kbytes (8 blocks), 32 kbytes (1 block), and 64 kbytes (3 blocks). the flash memory of the h8s/2266 and h8s/2265 is divided into 4 kbytes (8 blocks), 32 kbytes (1 block), and 64 kbytes (1 block). the flash memory of the h8s/2264 and h8s/2264r is divided into 1 kbyte (4 blocks), 28 kbytes (1 block), 16 kbytes (1 block), 8 kbytes (2 blocks), and 32 kbytes (2 blocks). erasing is performed in these units. programming is performed in 128-byte units starting from an address with lower eight bits h'00 or h'80.
rev. 2.0, 09/02, page 473 of 658 eb0 erase unit 4 kbytes eb1 erase unit 4 kbytes eb2 erase unit 4 kbytes eb3 erase unit 4 kbytes eb4 erase unit 4 kbytes eb5 erase unit 4 kbytes eb6 erase unit 4 kbytes eb7 erase unit 4 kbytes eb8 erase unit 32 kbytes eb9 erase unit 64 kbytes h'000000 h'000001 h'000002 h'00007f h'000fff h'00107f h'00207f h'00307f h'00407f h'004fff h'00507f h'005fff h'001fff h'002fff h'003fff h'01ffff h'00607f h'006fff h'00707f h'007fff h'00807f h'00ffff h'01007f h'001000 h'001001 h'001002 h'002000 h'002001 h'002002 h'003000 h'003001 h'003002 h'004000 h'004001 h'004002 h'005000 h'005001 h'005002 h'006000 h'006001 h'006002 h'007000 h'007001 h'007002 h'008000 h'008001 h'008002 h'010000 h'010001 h'010002 programming unit: 128 bytes programming unit: 128 bytes eb10 erase unit 64 kbytes h'02007f h'02ffff h'020000 h'020001 h'020002 programming unit: 128 bytes eb11 erase unit 64 kbytes h'03007f h'03ffff h'030000 h'030001 h'030002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes figure 20.5 flash memory block configuration (h8s/2268)
rev. 2.0, 09/02, page 474 of 658 eb0 erase unit 4 kbytes eb1 erase unit 4 kbytes eb2 erase unit 4 kbytes eb3 erase unit 4 kbytes eb4 erase unit 4 kbytes eb5 erase unit 4 kbytes eb6 erase unit 4 kbytes eb7 erase unit 4 kbytes eb8 erase unit 32 kbytes eb9 erase unit 64 kbytes h'000000 h'000001 h'000002 h'00007f h'000fff h'00107f h'00207f h'00307f h'00407f h'004fff h'00507f h'005fff h'001fff h'002fff h'003fff h'01ffff h'00607f h'006fff h'00707f h'007fff h'00807f h'00ffff h'01007f h'001000 h'001001 h'001002 h'002000 h'002001 h'002002 h'003000 h'003001 h'003002 h'004000 h'004001 h'004002 h'005000 h'005001 h'005002 h'006000 h'006001 h'006002 h'007000 h'007001 h'007002 h'008000 h'008001 h'008002 h'010000 h'010001 h'010002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes figure 20.6 flash memory block configuration (h8s/2266 and h8s/2265)
rev. 2.0, 09/02, page 475 of 658 eb0 erase unit 1 kbyte eb1 erase unit 1 kbyte eb2 erase unit 1 kbyte eb3 erase unit 1 kbyte eb4 erase unit 28 kbytes eb5 erase unit 16 kbytes eb6 erase unit 8 kbytes eb7 erase unit 8 kbytes eb8 erase unit 32 kbytes eb9 erase unit 32 kbytes h'000000 h'000001 h'000002 h'000380 h'000381 h'000382 h'000780 h'000781 h'000782 h'00007f h'0003ff h'00047f h'00087f h'000c7f h'00107f h'007fff h'00807f h'00bfff h'0007ff h'000bff h'000fff h'01ffff h'00c07f h'00dfff h'00e07f h'00ffff h'01007f h'017fff h'01807f h'000400 h'000401 h'000402 h'000800 h'000801 h'000802 h'000b80 h'000b81 h'000b82 h'000c00 h'000c01 h'000c02 h'000f80 h'000f81 h'000f82 h'001000 h'001001 h'001002 h'007f80 h'007f81 h'007f82 h'008000 h'008001 h'008002 h'00bf80 h'00bf81 h'00bf82 h'00c000 h'00c001 h'00c002 h'00df80 h'00df81 h'00df82 h'00e000 h'00e001 h'00e002 h'00ff80 h'00ff81 h'00ff82 h'01ff80 h'01ff81 h'01ff82 h'017f80 h'017f81 h'017f82 h'010000 h'010001 h'010002 h'018000 h'018001 h'018002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes figure 20.7 flash memory block configuration (h8s/2264 and h8s/2264r)
rev. 2.0, 09/02, page 476 of 658 20.4 input/output pins the flash memory is controlled by means of the pins shown in table 20.2. table 20.2 pin configuration pin name i/o function res input reset fwe input flash program/erase protection by hardware md2 input sets this lsi?s operating mode md1 input sets this lsi?s operating mode p70 input sets mcu operating mode in programmer mode p16 input sets mcu operating mode in programmer mode p14 input sets mcu operating mode in programmer mode txd0 output serial transmit data output rxd0 input serial receive data input 20.5 register descriptions the flash memory has the following registers. ? flash memory control register 1 (flmcr1) ? flash memory control register 2 (flmcr2) ? erase block register 1 (ebr1) ? erase block register 2 (ebr2) ? ram emulation register (ramer) ? flash memory power control register (flpwcr) ? serial control register x (scrx) the registers described above are not present in the masked rom version. if a register described above is read in the masked rom version, an undefined value will be returned.
rev. 2.0, 09/02, page 477 of 658 20.5.1 flash memory control register 1 (flmcr1) flmcr1 is a register that makes the flash memory change to program mode, program-verify mode, erase mode, or erase-verify mode. for details on register setting, refer to section 20.8, flash memory programming/erasing. bit bit name initial value r/w description 7 fwe ? r flash write enable bit reflects the input level at the fwe pin. it is set to 1 when a low level is input to the fwe pin, and cleared to 0 when a high level is input. when this bit is cleared to 0, the flash memory changes to hardware protect mode. 6 swe1 0 r/w software write enable bit when this bit is set to 1, flash memory programming/erasing is enabled. when this bit is cleared to 0, bits 5 to 0 in flmcr1 register and all ebr1 and ebr2 bits cannot be set. [setting condition] when fwe = 1. 5 esu1 0 r/w erase setup bit when this bit is set to 1, the flash memory changes to the erase setup state. when it is cleared to 0, the erase setup state is cancelled. set this bit to 1 before setting the e1 bit in flmcr1. [setting condition] when fwe = 1 and swe1 = 1 4 psu1 0 r/w program setup bit when this bit is set to 1, the flash memory changes to the program setup state. when it is cleared to 0, the program setup state is cancelled. set this bit to 1 before setting the p1 bit in flmcr1. [setting condition] when fwe = 1 and swe1 = 1 3 ev1 0 r/w erase-verify when this bit is set to 1, the flash memory changes to erase-verify mode. when it is cleared to 0, erase-verify mode is cancelled. [setting condition] when fwe = 1 and swe1 = 1
rev. 2.0, 09/02, page 478 of 658 bit bit name initial value r/w description 2 pv1 0 r/w program-verify when this bit is set to 1, the flash memory changes to program-verify mode. when it is cleared to 0, program-verify mode is cancelled. [setting condition] when fwe = 1 and swe1 = 1 1e1 0 r/werase when this bit is set to 1, and while the swe1 and esu1 bits are 1, the flash memory changes to erase mode. when it is cleared to 0, erase mode is cancelled. [setting condition] when fwe = 1, swe1 = 1, and esu1 = 1 0 p1 0 r/w program when this bit is set to 1, and while the swe1 and psu1 bits are 1, the flash memory changes to program mode. when it is cleared to 0, program mode is cancelled. when fwe = 1, swe1 = 1, and psu1 = 1 20.5.2 flash memory control register 2 (flmcr2) flmcr2 is a register that displays the state of flash memory programming/erasing. flmcr2 is a read-only register, and should not be written to. bit bit name initial value r/w description 7 fler 0 r indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error-protection state. see section 20.9.3, error protection, for details. 6 to 0 ? all 0 r reserved these bits are always read as 0. 20.5.3 erase block register 1 (ebr1) ebr1 specifies the flash memory erase area block. ebr1 is initialized to h'00 when the swe1 bit in flmcr1 is 0. do not set more than one bit at a time, as this will cause all the bits in ebr1 and ebr2 to be automatically cleared to 0.
rev. 2.0, 09/02, page 479 of 658 ? h8s/2268 series bit bit name initial value r/w description 7 eb7 0 r/w when this bit is set to 1, 4 kbytes of eb7 (h'007000 to h'007fff) will be erased. 6 eb6 0 r/w when this bit is set to 1, 4 kbytes of eb6 (h'006000 to h'006fff) will be erased. 5 eb5 0 r/w when this bit is set to 1, 4 kbytes of eb5 (h'005000 to h'005fff) will be erased. 4 eb4 0 r/w when this bit is set to 1, 4 kbytes of eb4 (h'004000 to h'004fff) will be erased. 3 eb3 0 r/w when this bit is set to 1, 4 kbytes of eb3 (h'003000 to h'003fff) will be erased. 2 eb2 0 r/w when this bit is set to 1, 4 kbytes of eb2 (h'002000 to h'002fff) will be erased. 1 eb1 0 r/w when this bit is set to 1, 4 kbytes of eb1 (h'001000 to h'001fff) will be erased. 0 eb0 0 r/w when this bit is set to 1, 4 kbytes of eb0 (h'000000 to h'000fff) will be erased. ? h8s/2264 series bit bit name initial value r/w description 7 eb7 0 r/w when this bit is set to 1, 8 kbytes of eb7 (h'00e000 to h'00ffff) will be erased. 6 eb6 0 r/w when this bit is set to 1, 8 kbytes of eb6 (h'00c000 to h'00dfff) will be erased. 5 eb5 0 r/w when this bit is set to 1, 16 kbytes of eb5 (h'008000 to h'00bfff) will be erased. 4 eb4 0 r/w when this bit is set to 1, 28 kbytes of eb4 (h'001000 to h'007fff) will be erased. 3 eb3 0 r/w when this bit is set to 1, 1 kbyte of eb3 (h'000c00 to h'000fff) will be erased. 2 eb2 0 r/w when this bit is set to 1, 1 kbyte of eb2 (h'000800 to h'000bff) will be erased. 1 eb1 0 r/w when this bit is set to 1, 1 kbyte of eb1 (h'000400 to h'0007ff) will be erased. 0 eb0 0 r/w when this bit is set to 1, 1 kbyte of eb0 (h'000000 to h'0003ff) will be erased.
rev. 2.0, 09/02, page 480 of 658 20.5.4 erase block register 2 (ebr2) ebr2 specifies the flash memory erase area block. ebr2 is initialized to h'00 when the swe1 bit in flmcr1 is 0. do not set more than one bit at a time, as this will cause all the bits in ebr1 and ebr2 to be automatically cleared to 0. ? h8s/2268 series bit bit name initial value r/w description 7 to 4 ? all 0 r/w reserved these bits are always read as 0. only 0 should be written to these bits. 3 eb11 * 0 r/w when this bit is set to 1, 64 kbytes of eb11 (h'030000 to h'03ffff) will be erased. 2 eb10 * 0 r/w when this bit is set to 1, 64 kbytes of eb10 (h'020000 to h'02ffff) will be erased. 1 eb9 0 r/w when this bit is set to 1, 64 kbytes of eb9 (h'010000 to h'01ffff) will be erased. 0 eb8 0 r/w when this bit is set to 1, 32 kbytes of eb8 (h'008000 to h'00ffff) will be erased. note: * these bits are reserved bits in the h8s/2266 and h8s/2265. only 0 should be written to these bits. ? h8s/2264 series bit bit name initial value r/w description 7 to 2 ? all 0 r/w reserved these bits are always read as 0. only 0 should be written to these bits. 1 eb9 0 r/w when this bit is set to 1, 32 kbytes of eb9 (h'018000 to h'01ffff) will be erased. 0 eb8 0 r/w when this bit is set to 1, 32 kbytes of eb8 (h'010000 to h'017fff) will be erased. 20.5.5 ram emulation register (ramer) ramer specifies the area of flash memory to be overlapped with part of ram when emulating real-time flash memory programming. ramer settings should be made in user mode or user program mode. to ensure correct operation of the emulation function, the rom for which ram emulation is performed should not be accessed immediately after this register has been modified. normal execution of an access immediately after register modification is not guaranteed.
rev. 2.0, 09/02, page 481 of 658 ? h8s/2268 series bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. 4? 0 r/wreserved only 0 should be written to this bit. 3 rams 0 r/w ram select specifies selection or non-selection of flash memory emulation in ram. when rams = 1, the flash memory is overlapped with part of ram, and all flash memory block are program/erase- protected. 2 1 0 ram2 ram1 ram0 0 0 0 r/w r/w r/w flash memory area selection when the rams bit is set to 1, one of the following flash memory areas is selected to overlap the ram area. the areas correspond with 4-kbyte erase blocks. 000: h'000000 to h'000fff (eb0) 001: h'001000 to h'001fff (eb1) 010: h'002000 to h'002fff (eb2) 011: h'003000 to h'003fff (eb3) 100: h'004000 to h'004fff (eb4) 101: h'005000 to h'005fff (eb5) 110: h'006000 to h'006fff (eb6) 111: h'007000 to h'007fff (eb7) ? h8s/2264 series bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. 4? 0 r/wreserved only 0 should be written to this bit. 3 rams 0 r/w ram select specifies selection or non-selection of flash memory emulation in ram. when rams = 1, the flash memory is overlapped with part of ram, and all flash memory block are program/erase- protected.
rev. 2.0, 09/02, page 482 of 658 bit bit name initial value r/w description 2? 0 r/wreserved only 0 should be written to this bit. 1 0 ram1 ram0 0 0 r/w r/w flash memory area selection when the rams bit is set to 1, one of the following flash memory areas is selected to overlap the ram area. the areas correspond with 1-kbyte erase block. 00: h'000000 to h'0003ff (eb0) 01: h'000400 to h'0007ff (eb1) 10: h'000800 to h'00bfff (eb2) 11: h'000c00 to h'000fff (eb3) 20.5.6 flash memory power control register (flpwcr) flpwcr enables/disables transition to power-down modes for the flash memory when this lsi enters sub-active mode. bit bit name initial value r/w description 7 pdwnd 0 r/w power down disable enables/disables transition to power-down modes for the flash memory when this lsi enters sub- active mode. 0: transition to power-down modes for the flash memory enabled. 1: transition to power-down modes for the flash memory disabled. 6 to 0 ? all 0 r reserved these bits are always read as 0.
rev. 2.0, 09/02, page 483 of 658 20.5.7 serial control register x (scrx) scrx performs register access control. bit bit name initial value r/w description 7? 0 r/wreserved only 0 should be written to this bit. 6 5 iicx1 iicx0 0 0 r/w r/w i 2 c transfer select 1, 0 for details, see section 14.3.5, serial control register x (scrx). 4 iice 0 r/w i 2 c master enable for details, see section 14.3.5, serial control register x (scrx). 3 flshe 0 r/w flash memory control register enable controls for the cpu accessing to the control registers (flmcr1, flmcr2, ebr1, ebr2) of the flash memory. when this bit is set to 1, the flash memory control registers can be read/written to. when this bit is cleared to 0, the flash memory control registers are not selected. at this time, the contents of the flash memory control registers are retained. 0: area at h'ffffa8 to h'ffffac not selected for the flash memory control registers. 1: area at h'ffffa8 to h'ffffac selected for the flash memory control registers. 2 to 0 ? all 0 r/w reserved only 0 should be written to these bits.
rev. 2.0, 09/02, page 484 of 658 20.6 on-board programming modes when pins are set to on-board programming mode, program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 20.3. for a diagram of the transitions to the various flash memory modes, see figure 20.2. table 20.3 setting on-board programming modes fwe md2 md1 mode setting 110boot mode 111user program mode * 011user mode note: * to set user program mode in the h8s/2264 series, reset state should be cancelled when the p76 pin is driven high by pulling the pin up on the board. 20.6.1 boot mode table 20.4 shows the boot mode operations between reset end and branching to the programming control program. 1. when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. prepare a programming control program in accordance with the description in section 20.8, flash memory programming/erasing. in boot mode, if any data has been programmed into the flash memory (if all data is not 1), all flash memory blocks are erased. boot mode is for use when user program mode is unavailable, such as the first time on-board programming is performed, or if the program activated in user program mode is accidentally erased. 2. sci_0 should be set to asynchronous mode, and the transfer format as follows: 8-bit data, 1 stop bit, and no parity. 3. when the boot program is initiated, the chip measures the low-level period of asynchronous sci communication data (h'00) transmitted continuously from the host. the chip then calculates the bit rate of transmission from the host, and adjusts the sci_0 bit rate to match that of the host. the reset should end with the rxd pin high. the rxd and txd pins should be pulled up on the board if necessary. after the reset is complete, it takes approximately 100 states before the chip is ready to measure the low-level period. 4. after matching the bit rates, the chip transmits one h'00 byte to the host to indicate the completion of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, and transmit one h'55 byte to the chip. if reception could not be performed normally, initiate boot mode again by a reset. depending on the host's transfer bit rate and system clock frequency of this lsi, there will be a discrepancy between
rev. 2.0, 09/02, page 485 of 658 the bit rates of the host and the chip. to operate the sci properly, set the host's transfer bit rate and system clock frequency of this lsi within the ranges listed in table 20.5. 5. in boot mode, a part of the on-chip ram area is used by the boot program. the area h'ffc000 to h'ffdfff is the area to which the programming control program is transferred from the host in the h8s/2268 series. in the h8s/2266 and h8s/2265, the ram in this area is enabled only in boot mode. the area h?ffe000 to h?ffe7ff is the area to which the programming control program is transferred from the host in the h8s/2264 series. the boot program area cannot be used until the execution state in boot mode switches to the programming control program. 6. before branching to the programming control program, the chip terminates transfer operations by sci_0 (by clearing the re and te bits in scr to 0), however the adjusted bit rate value remains set in brr. therefore, the programming control program can still use it for transfer of write data or verify data with the host. the txd pin is high. the contents of the cpu general registers are undefined immediately after branching to the programming control program. these registers must be initialized at the beginning of the programming control program, as the stack pointer (sp), in particular, is used implicitly in subroutine calls, etc. 7. boot mode can be cleared by driving the reset pin low, waiting at least 20 states, then setting the fwe pin and mode pins, and executing reset release*. boot mode is also cleared when a wdt overflow occurs. 8. all interrupts are disabled during programming or erasing of the flash memory. note: the input signals on the fwe and mode pins must satisfy the mode programming setup time (t mds = 200 ns) at the reset release timing. in the h8s/2264 series, reset state should be cancelled when the p76 pin is driven high by pulling the pin up.
rev. 2.0, 09/02, page 486 of 658 table 20.4 boot mode operation item host operation communications contents lsi operation boot mode start branches to boot program at reset-start. processing contents processing contents bit rate adjustment continuously transmits data h'00 at specified bit rate. h'00, h'00 ...... h'00 h'00 h'55 measures low-level period of receive data h'00. calculates bit rate and sets it in brr of sci_0. transmits data h'00 to host as adjustment end indication. transmits data h'aa to host when data h'55 is received. transmits data h'55 when data h'00 is received error-free. transmits number of bytes (n) of programming control program to be transferred as 2-byte data (low-order byte following high-order byte) receives data h'aa. transmits 1-byte of programming control program (repeated for n times) receives data h'aa. transfer of programming control program flash memory erase boot program initiation echobacks the 2-byte data received. branches to programming control program transferred to on-chip ram and starts execution. echobacks received data to host and also transfers it to ram (repeated for n times) checks flash memory data, erases all flash memory blocks in case of written data existing, and transmits data h'aa to host. (if erase could not be done, transmits data h'ff to host and aborts operation.) high-order byte and low-order byte h'xx h'aa echoback echoback h'ff h'aa boot program erase error table 20.5 system clock frequencies for which automatic adjustment of lsi bit rate is possible host bit rate system clock frequency range of this lsi 19,200 bps 8 to 20.5 mhz 9,600 bps 4 to 20.5 mhz 4,800 bps 2 to 20.5 mhz
rev. 2.0, 09/02, page 487 of 658 20.6.2 programming/erasing in user program mode on-board programming/erasing of an individual flash memory block can also be performed in user program mode by branching to a user program/erase control program. the user must prepare on- board means for controlling fwe, on-board means of supplying programming data, and branching conditions. the flash memory must contain the user program/erase control program or a program that provides the user program/erase control program from external memory. as the flash memory itself cannot be read during programming/erasing, transfer the user program/erase control program to on-chip ram, as in boot mode. figure 20.8 shows a sample procedure for programming/erasing in user program mode. prepare a user program/erase control program in accordance with the description in section 20.8, flash memory programming/erasing. ye s no program/erase? transfer user program/erase control program to ram reset-start branch to user program/erase control program in ram execute user program/erase control program (flash memory rewrite) branch to flash memory application program branch to flash memory application program figure 20.8 programming/erasing flowchart example in user program mode
rev. 2.0, 09/02, page 488 of 658 20.7 flash memory emulation in ram a setting in the ram emulation register (ramer) enables part of ram to be overlapped onto the flash memory area so that data to be written to flash memory can be emulated in ram in real time. emulation can be performed in user mode or user program mode. figure 20.9 shows an example of emulation of real-time flash memory programming. 1. set ramer to overlap part of ram onto the area for which real-time programming is required. 2. emulation is performed using the overlapping ram. 3. after the program data has been confirmed, the rams bit is cleared, thus releasing the ram overlap. 4. the data written in the overlapping ram is written into the flash memory space. start of emulation program set ramer write tuning data to overlap ram execute application program tuning ok? clear ramer write to flash memory emulation block end of emulation program no ye s figure 20.9 flowchart for flash memory emulation in ram
rev. 2.0, 09/02, page 489 of 658 an example in which flash memory block area eb0 is overlapped is shown in figures 20.10 and 20.11. 1. the ram area to be overlapped is fixed at a 4-kbyte area in the range h'ffd000 to h'ffdfff in the h8s/2268 series. in the h8s/2265, the ram in this area is enabled only in ram emulation mode. the ram area to be overlapped is fixed at a 1-kbyte area in the range h?ffe000 to h?ffe3ff in the h8s/2264 series. 2. the flash memory area to be overlapped is selected by ramer from a 4-kbyte area of the eb0 to eb7 blocks in the h8s/2268 series. the flash memory area to be overlapped is selected by ramer from a 1-kbyte area of the eb0 to eb3 blocks in the h8s/2264 series. 3. the overlapped ram area can be accessed from both the flash memory addresses and ram addresses. 4. when the rams bit in ramer is set to 1, program/erase protection is enabled for all flash memory blocks (emulation protection). in this state, setting the p1 or e1 bit in flmcr1 to 1 does not cause a transition to program mode or erase mode. 5. a ram area cannot be erased by execution of software in accordance with the erase algorithm. 6. block area eb0 contains the vector table. when performing ram emulation, the vector table is needed in the overlap ram.
rev. 2.0, 09/02, page 490 of 658 h'000000 h'001000 h'002000 h'003000 h'ffd000 h'ffdfff flash memory (eb0) flash memory (eb0) (eb1) (eb2) (eb3) on-chip ram (4 kbytes) on-chip ram (shadow of h'ffd000 to h'ffdfff) flash memory (eb2) on-chip ram (4 kbytes) (eb3) normal memory map ram overlap memory map figure 20.10 example of ram overlap operation (h8s/2268 series)
rev. 2.0, 09/02, page 491 of 658 h'000000 h'0003ff h'0007ff h'000bff h'000fff h'000400 h'000800 h'000c00 h'ffe000 h'ffe3ff flash memory (eb0) flash memory (eb0) (eb1) (eb2) (eb3) on-chip ram (1 kbyte) on-chip ram (shadow of h'ffe000 to h'ffe3ff) flash memory (eb2) on-chip ram (1 kbyte) (eb3) normal memory map ram overlap memory map figure 20.11 example of ram overlap operation (h8s/2264 series)
rev. 2.0, 09/02, page 492 of 658 20.8 flash memory programming/erasing a software method using the cpu is employed to program and erase flash memory in the on- board programming modes. depending on the flmcr1 setting, the flash memory operates in one of the following four modes: program mode, program-verify mode, erase mode, and erase-verify mode. the programming control program in boot mode and the user program/erase control program in user program mode use these operating modes in combination to perform programming/erasing. flash memory programming and erasing should be performed in accordance with the descriptions in section 20.8.1, program/program-verify and section 20.8.2, erase/erase-verify, respectively. 20.8.1 program/program-verify when writing data or programs to the flash memory, the program/program-verify flowchart shown in figure 20.12 should be followed. performing programming operations according to this flowchart will enable data or programs to be written to the flash memory without subjecting the chip to voltage stress or sacrificing program data reliability. 1. programming must be done to an empty address. do not reprogram an address to which programming has already been performed. 2. programming should be carried out 128 bytes at a time. a 128-byte data transfer must be performed even if writing fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. 3. prepare the following data storage areas in ram: a 128-byte programming data area, a 128- byte reprogramming data area, and a 128-byte additional-programming data area. perform reprogramming data computation and additional programming data computation according to figure 20.12. 4. consecutively transfer 128 bytes of data in byte units from the reprogramming data area or additional-programming data area to the flash memory. the program address and 128-byte data are latched in the flash memory. the lower 8 bits of the start address in the flash memory destination area must be h'00 or h'80. 5. the time during which the p1 bit is set to 1 is the programming time. figure 20.12 shows the allowable programming times. 6. the watchdog timer (wdt) is set to prevent overprogramming due to program runaway, etc. set a value greater than (tspsu + tsp200 + tcp + tcpsu) s as the wdt overflow period. 7. for a dummy write to a verify address, write 1-byte data h'ff to an address whose lower 2 bits are b'00. verify data can be read in words from the address to which a dummy write was performed. 8. the maximum number of repetitions of the program/program-verify sequence of the same bit is (n).
rev. 2.0, 09/02, page 493 of 658 start end of programming set swe1 bit in flmcr1 start of programming write pulse application subroutine wait (t sswe ) 1 s sub-routine write pulse end sub set psu1 bit in flmcr1 wdt enable disable wdt number of writes n 1 2 3 4 5 6 7 8 9 10 11 12 13 998 999 1000 note 6: write pulse width write time (tsp30/tsp200) s 30 30 30 30 30 30 200 200 200 200 200 200 200 200 200 200 wait (t spsu ) 50 s set p1 bit in flmcr1 wait t sp10 or 30 or 200 clear p1 bit in flmcr1 wait (t cp ) 5 s clear psu1 bit in flmcr1 wait (t cpsu ) 5 s n= 1 m= 0 no no no no yes yes yes wait (t spv ) 4 s t spvr = wait 2 s * 2 * 4 start of programming end of programming * 5 * 1 wait (t cpv ) s apply write pulse t sp 30 or 200 sub-routine-call set pv1 bit in flmcr1 h'ff dummy write to verify address read verify data write data = verify data? * 4 * 3 * 1 transfer reprogram data to reprogram data area reprogram data computation * 4 transfer additional-programming data to additional-programming data area additional-programming data computation clear pv1 bit in flmcr1 clear swe1 bit in flmcr1 m = 1 reprogram see note 6 for pulse width m= 0 ? increment address programming failure yes clear swe1 bit in flmcr1 wait (t cswe ) 100 s no yes 6 n? no yes 6 n ? wait (t cswe ) 100 s n 1000? n n + 1 original data (d) verify data (v) reprogram data (x) comments programming completed still in erased state; no action programming incomplete; reprogram note: * use a 10 s write pulse for additional programming. write 128-byte data in ram reprogram data area consecutively to flash memory ram program data storage area (128 bytes) reprogram data storage area (128 bytes) additional-programming data storage area (128 bytes) store 128-byte program data in program data area and reprogram data area apply write pulse (additional programming) sub-routine-call 128-byte data verification completed? successively write 128-byte data from additional- programming data area in ram to flash memory reprogram data computation table reprogram data (x') verify data (v) additional- programming data (y) 1 1 1 1 0 1 0 0 0 0 1 1 comments additional programming to be executed additional programming not to be executed additional programming not to be executed additional programming not to be executed 0 1 1 1 0 1 0 1 0 0 1 1 additional-programming data computation table perform programming in the erased state. do not perform additional programming on previously programmed addresses. notes: 1. data transfer is performed by byte transfer. the lower 8 bits of the first address written to must be h'00 or h'80. a 128-byte data transfer must be performed even if writing fewer than 128 bytes; in this case, h'ff data must be written to the extra addresses. 2. verify data is read in 16-bit (word) units. 3. reprogram data is determined by the operation shown in the table below (comparison between the data stored in the program dat a area and the verify data). bits for which the reprogram data is 0 are programmed in the next reprogramming loop. therefore, even bits for which programming has bee n completed will be subjected to programming once again if the result of the subsequent verify operation is ng. 4. a 128-byte area for storing program data, a 128-byte area for storing reprogram data, and a 128-byte area for storing additio nal data must be provided in ram. the contents of the reprogram data area and additional data area are modified as programming proceeds. 5. a write pulse of 30 s or 200 s is applied according to the progress of the programming operation. see note 6 for details of the pulse widths. when writing o f additional-programming data is executed, a 10 s write pulse should be applied. reprogram data x' means reprogram data when the write pulse is applied. * * * * * * figure 20.12 program/program-verify flowchart
rev. 2.0, 09/02, page 494 of 658 20.8.2 erase/erase-verify when erasing flash memory, the erase/erase-verify flowchart shown in figure 20.13 should be followed. 1. prewriting (setting erase block data to all 0) is not necessary. 2. erasing is performed in block units. make only a single-bit specification in the erase block register 1 and 2 (ebr1 and ebr2). to erase multiple blocks, each block must be erased in turn. 3. the time during which the e1 bit is set to 1 is the flash memory erase time. 4. the watchdog timer (wdt) is set to prevent overprogramming due to program runaway, etc. set a value greater than (t sesu + t se + t ce + t cesu ) ms as the wdt overflow period. 5. for a dummy write to a verify address, write 1-byte data h'ff to an address whose lower two bits are b'00. verify data can be read in words from the address to which a dummy write was performed. 6. if the read data is not erased successfully, set erase mode again, and repeat the erase/erase- verify sequence as before. the maximum number of repetitions of the erase/erase-verify sequence is (n). 20.8.3 interrupt handling when programming/erasing flash memory all interrupts, including the nmi interrupt, are disabled while flash memory is being programmed or erased, or while the boot program is executing, for the following three reasons: 1. interrupt during programming/erasing may cause a violation of the programming or erasing algorithm, with the result that normal operation cannot be assured. 2. if interrupt exception handling starts before the vector address is written or during programming/erasing, a correct vector cannot be fetched and the cpu malfunctions. 3. if an interrupt occurs during boot program execution, normal boot mode sequence cannot be carried out.
rev. 2.0, 09/02, page 495 of 658 erase start set ebr1 (2) enable wdt disable wdt read verify data increment address verify data = all 1? last address of block? all erase block erased? set block start address as verify address h'ff dummy write to verify address swe1 bit in flmcr1 1 n = 1 esu1 bit in flmcr1 1 e1 bit in flmcr1 1 start erasing stop erasing tsswe: wait 1 s tsesu: wait 100 s e1 bit in flmcr1 0 ev1 bit in flmcr1 1 tse: wait 10 ms esu1 bit in flmcr1 0 tce: wait 10 s tcesu: wait 10 s tsev: wait 20 s ev1 bit in flmcr1 0 n n + 1 tcev: wait 4 s swe1 bit in flmcr1 0 tcswe: wait 100 s ev1 bit in flmcr1 0 n 100? tcev: wait 4 s swe1 bit in flmcr1 0 tcswe: wait 100 s erase failure end of erasing tsevr: wait 2 s no yes ye s no no no ye s ye s * 1 * 3 * 2 * 4 erasing should be done to a block 1. pre-writing (all erase block data are cleared to 0) is not necessary. 2. verify data is read out in 16 bit size (word access). 3. erasing block register (ebr) can be set about 1 bit at a time. do not specify 2 bits or more. 4. erasing is performed block by block. when multiple blocks must be erased, erase each lock one by one. notes: figure 20.13 erase/erase-verify flowchart
rev. 2.0, 09/02, page 496 of 658 20.9 program/erase protection there are three kinds of flash memory program/erase protection; hardware protection, software protection, and error protection. 20.9.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted because of a transition to reset or standby mode. flash memory control register 1 (flmcr1), flash memory control register 2 (flmcr2), erase block register 1 (ebr1), and erase block register 2 (ebr2) are initialized. in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section. 20.9.2 software protection software protection can be implemented against programming/erasing of all flash memory blocks by clearing the swe1 bit in flmcr1. when software protection is in effect, setting the p1 or e1 bit in flmcr1 does not cause a transition to program mode or erase mode. by setting the erase block register 1 and 2 (ebr1 and ebr2), erase protection can be set for individual blocks. when ebr1 and ebr2 are set to h?00, erase protection is set for all blocks. by setting bit rams in ramer, programming/erase protection is set for all blocks. 20.9.3 error protection in error protection, an error is detected when cpu runaway occurs during flash memory programming/erasing, or operation is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. when the following errors are detected during programming/erasing of flash memory, the fler bit in flmcr2 is set to 1, and the error protection state is entered. ? when the flash memory of the relevant address area is read during programming/erasing (including vector read and instruction fetch) ? immediately after exception handling (excluding a reset) during programming/erasing ? when a sleep instruction is executed during programming/erasing ? when the cpu loses the bus during programming/erasing (supported only by the h8s/2268 series) the flmcr1, flmcr2, ebr1, and ebr2 settings are retained, however program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be
rev. 2.0, 09/02, page 497 of 658 re-entered by re-setting the p1 or e1 bit. however, pv1 and ev1 bit setting is enabled, and a transition can be made to verify mode. error protection can be cleared only by a reset or in hardware standby. 20.10 interrupt handling when programming/erasing flash memory all interrupts, including nmi input, are disabled when flash memory is being programmed or erased (when the p1 or e1 bit is set in flmcr1), and while the boot program is executing in boot mode* 1 , to give priority to the program or erase operation. there are three reasons for this: 1. interrupt during programming or erasing might cause a violation of the programming or erasing algorithm, with the result that normal operation could not be assured. 2. in the interrupt exception handling sequence during programming or erasing, the vector would not be read correctly* 2 , possibly resulting in cpu runaway. 3. if an interrupt occurred during boot program execution, it would not be possible to execute the normal boot mode sequence. notes: 1. interrupt requests must be disabled inside and outside the cpu until the programming control program has completed programming. 2. the vector may not be read correctly in this case for the following two reasons:  if flash memory is read while being programmed or erased (while the p1 or e1 bit is set in flmcr1), correct read data will not be obtained (undetermined values will be returned).  if the interrupt entry in the vector table has not been programmed yet, interrupt exception handling will not be executed correctly. 20.11 programmer mode in programmer mode, a prom programmer can be used to perform programming/erasing via a socket adapter, just as for a discrete flash memory. use a prom programmer which supports the hitachi 256-kbyte flash memory on-chip microcomputer device type (fztat256v3a) and the hitachi 128-kbyte flash memory on-chip microcomputer device type (fztat128v3a). the socket adapter pin correspondence diagram is shown in figure 20.14.
rev. 2.0, 09/02, page 498 of 658 this lsi socket adapter (conversion to 40-pin arrangement) fp-100b,tfp-100b, tfp-100g pin no. pin name a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 d0 d1 d2 d3 d4 d5 d6 d7 fwe hn27c4096hg (40-pin) pin no. pin name 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 10 19 18 17 16 15 14 13 12 2 20 3 4 1, 40 11, 30 5, 6, 7 8 9 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 i/o0 i/o1 i/o2 i/o3 i/o4 i/o5 i/o6 i/o7 fwe v cc v ss nc a20 a19 xtal extal n.c.(open) 17 16 15 13 11 10 9 8 7 6 5 4 3 2 1 100 99 98 97 25 24 23 22 21 20 19 18 26 28 27 66 59 63 65 other than the above 12, 30, 53, 54, 58, 60, 61, 62, 75 14, 29, 38, 40,42, 56, 64, 67 v cc v ss oscillator circuit legend fwe: i/o0 to 7: a20 to 0: : : : flash write enable data input/output address input output enable chip enable write enable power-on reset circuit note: this drawing indicates pin correspondences and does not show the entire circuitry of the socket adapter. figure 20.14 socket adapter pin correspondence diagram
rev. 2.0, 09/02, page 499 of 658 20.12 power-down states for flash memory in user mode, the flash memory will operate in either of the following states: ? normal operating mode the flash memory can be read and written to at high speed. ? power-down state the flash memory can be read when part of the power circuit is halted and the lsi operates by subclocks. ? standby mode all flash memory circuits are halted. table 20.6 shows the correspondence between the operating modes of the h8s/2268 series and the flash memory. when the flash memory returns to its normal operating state from standby mode, a period to stabilize the power supply circuits that were stopped is needed. when the flash memory returns to its normal operating state, bits sts2 to sts0 in sbycr must be set to provide a wait time of at least 100 s (at least tbd s for the h8s/2264r), even when the external clock is being used. table 20.6 flash memory operating states lsi operating state flash memory operating state active mode normal operating mode sleep mode normal operating mode watch mode standby mode standby mode sub-active mode sub-sleep mode pdwnd = 0: power-down mode (read only) pdwnd = 1: normal operating mode (read only)
rev. 2.0, 09/02, page 500 of 658 20.13 flash memory programming and erasing precautions precautions concerning the use of on-board programming mode, the ram emulation function, and programmer mode are summarized below. use the specified voltages and timing for programming and erasing: applied voltages in excess of the rating can permanently damage the device. use a prom programmer that supports the hitachi 256-kbyte flash memory on-chip microcomputer device type (fztat256v3a and the hitachi 128-kbyte flash memory on-chip microcomputer device type (fztat128v3a). do not select the hn27c4096, hn27c101, and hn28f101 setting for the prom programmer, and only use the specified socket adapter. failure to observe these points may result in damage to the device. powering on and off (see figures 20.15 to 20.17): do not apply a high level to the fwe pin until vcc has stabilized. also, drive the fwe pin low before turning off vcc. when applying or disconnecting vcc power, fix the fwe pin low and place the flash memory in the hardware protection state. the power-on and power-off timing requirements should also be satisfied in the event of a power failure and subsequent recovery. fwe application/disconnection (see figures 20.15 to 20.17): fwe application should be carried out when mcu operation is in a stable condition. if mcu operation is not stable, fix the fwe pin low and set the protection state. the following points must be observed concerning fwe application and disconnection to prevent unintentional programming or erasing of flash memory: ? apply fwe when the vcc voltage has stabilized within its rated voltage range. ? in boot mode, apply and disconnect fwe during a reset. ? in user program mode, fwe can be switched between high and low level regardless of the reset state. fwe input can also be switched during execution of a program in flash memory. ? do not apply fwe if program runaway has occurred. ? disconnect fwe only when the swe1, esu1, psu1, ev1, pv1, p1, and e1 bits in flmcr1 are cleared. make sure that the swe1, esu1, psu1, ev1, pv1, p1, and e1 bits are not set by mistake when applying or disconnecting fwe.
rev. 2.0, 09/02, page 501 of 658 do not apply a constant high level to the fwe pin: apply a high level to the fwe pin only when programming or erasing flash memory. a system configuration in which a high level is constantly applied to the fwe pin should be avoided. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasing due to program runaway, etc. use the recommended algorithm when programming and erasing flash memory: the recommended algorithm enables programming and erasing to be carried out without subjecting the device to voltage stress or sacrificing program data reliability. when setting the p1 or e1 bit in flmcr1, the watchdog timer should be set beforehand as a precaution against program runaway, etc. do not set or clear the swe1 bit during execution of a program in flash memory: wait for at least 100 s after clearing the swe1 bit before executing a program or reading data in flash memory. when the swe1 bit is set, data in flash memory can be rewritten. access flash memory only for verify operations (verification during programming/erasing). also, do not clear the swe1 bit during programming, erasing, or verifying. similarly, when using the ram emulation function while a high level is being input to the fwe pin, the swe1 bit must be cleared before executing a program or reading data in flash memory. however, the ram area overlapping flash memory space can be read and written to regardless of whether the swe1 bit is set or cleared. do not use interrupts while flash memory is being programmed or erased: all interrupt requests, including nmi, should be disabled during fwe application to give priority to program/erase operations. do not perform additional programming. erase the memory before reprogramming: in on- board programming, perform only one programming operation on a 128-byte programming unit block. in programmer mode, too, perform only one programming operation on a 128-byte programming unit block. programming should be carried out with the entire programming unit block erased. before programming, check that the chip is correctly mounted in the prom programmer: overcurrent damage to the device can result if the index marks on the prom programmer socket, socket adapter, and chip are not correctly aligned. do not touch the socket adapter or chip during programming: touching either of these can cause contact faults and write errors. reset the flash memory before turning on the power: to reset the flash memory during oscillation stabilization period, the reset signal must be input for at least 100 s (at least tbd s for the h8s/2264r).
rev. 2.0, 09/02, page 502 of 658 apply the reset signal while swe1 is low to reset the flash memory during its operation: the reset signal is applied at least 100 s after the swe1 bit has been cleared. 1 2 3 except when switching modes, the level of the mode pins (md2, md1) must be fixed until power-off by pulling the pins up or down. in the h8s/2264 series, the level of the p76 pin must be fixed by pulling the pin up. see sections 26.2.8 and 26.3.6, flash memory characteristics. mode programming setup time t mds (min) = 200ns. period during which flash memory access is prohibited (t sswe : wait time after setting swe1 bit) * 2 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: v cc fwe t osc1 min 0 s min 0 s t mds * 3 t mds * 3 md2, md1 * 1 swe1bit swe1 set swe1 cleared t sswe 100 s programming/ erasing possible wait time: wait time: figure 20.15 power-on/off timing (boot mode)
rev. 2.0, 09/02, page 503 of 658 swe1 set swe1 cleared v cc fwe t osc1 min 0 s md2,md1 * 1 swe1 bit t sswe t mds * 3 s 1 2 3 except when switching modes, the level of the mode pins (md2, md1) must be fixed until power-off by pulling the pins up or down. in the h8s/2264 series, the level of the p76 pin must be fixed by pulling the pin up. see sections 26.2.8 and 26.3.6, flash memory characteristics. mode programming setup time t mds (min) = 200ns. period during which flash memory access is prohibited (t sswe : wait time after setting swe1 bit) * 2 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: programming/ erasing possible wait time: wait time: figure 20.16 power-on/off timing (user program mode)
rev. 2.0, 09/02, page 504 of 658 v cc fwe t osc1 min 0 s t mds t mds t mds t resw md2,md1 swe1 bit mode change boot mode mode change user mode user program mode user mode user program mode swe1 set swe1 cleared t sswe * 4 * 4 * 4 * 2 1 2 3 4 when entering boot mode or making a transition from boot mode to another mode, mode switching must be carried out by means of input. in the h8s/2264 series, the level of the p76 pin must be fixed by pulling the pin up when mode switching is carried out by means of input. when making a transition from boot mode to another mode, a mode programming setup time t mds (min) of 200 ns is necessary with respect to clearance timing. see sections 26.2.8 and 26.3.6, flash memory characteristics. wait time: 100 s. period during which flash memory access is prohibited (t sswe : wait time after setting swe1 bit) * 3 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: * 1 * 1 wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible figure 20.17 mode transition timing (example: boot mode user mode ? ? ? ? user program mode)
rev. 2.0, 09/02, page 505 of 658 20.14 note on switching from f-ztat version to masked rom version the masked rom version does not have the internal registers for flash memory control that are provided in the f-ztat version. table 20.7 lists the registers that are present in the f-ztat version but not in the masked rom version. if a register listed in table 20.7 is read in the masked rom version, an undefined value will be returned. therefore, if application software developed on the f-ztat version is switched to a masked rom version product, it must be modified to ensure that the registers in table 20.7 have no effect. table 20.7 registers present in f-ztat version but absent in masked rom version register abbreviation address flash memory control register 1 flmcr1 h'ffa8 flash memory control register 2 flmcr2 h'ffa9 erase block register 1 ebr1 h'ffaa erase block register 2 ebr2 h'ffab ram emulation register ramer h'fedb flash memory power control register flpwcr h'ffac serial control register x (only bit 3) scrx h'fdb4
rev. 2.0, 09/02, page 506 of 658
rev. 2.0, 09/02, page 507 of 658 section 21 clock pulse generator this lsi has an on-chip clock pulse generator that generates the system clock ( ), the bus master clock, and internal clocks. the clock pulse generator consists of an oscillator, duty adjustment circuit, clock selection circuit, medium-speed clock divider, bus master clock selection circuit, subclock oscillator, and wave formation circuit. a block diagram of the clock pulse generator of the h8s/2268 series is shown in figure 21.1. a block diagram of the clock pulse generator of the h8s/2264 series is shown in figure 21.2. legend: lpwrcr: sckcr: low-power control register system clock control register extal xtal duty adjustment circuit medium- speed clock divider system clock oscillator clock selection circuit sub wdt_1, tmr4, lcd count clock internal clock to peripheral modules bus master clock to cpu and dtc /2 to /32 internal clock sck2 to sck0 sckcr rfcut osc1 osc2 waveform generation circuit subclock oscillator lpwrcr bus master clock selection circuit figure 21.1 block diagram of clock pulse generator (h8s/2268 series) cpg0501b_000020020700
rev. 2.0, 09/02, page 508 of 658 legend: lpwrcr: sckcr: sckcr2: low-power control register system clock control register system clock control register 2 extal xtal duty adjustment circuit medium- speed clock divider system clock oscillator clock selection circuit sub lcd count clock wdt_1 count clock internal clock to peripheral modules output clock to pin bus master clock to cpu /2 to /32 to /131072, sub /2 to sub /256 sub /4 sub /60 internal clock sck2 to sck0 sckcr selector selector sckcr2 phoe phck3 to phck0 subcks1, subcks0 divided by 4 divided by 60 rfcut osc1 osc2 waveform generation circuit subclock oscillator lpwrcr bus master clock selection circuit figure 21.2 block diagram of clock pulse generator (h8s/2264 series) frequency changes are performed by software by settings in the low-power control register (lpwrcr) and system clock control register (sckcr).
rev. 2.0, 09/02, page 509 of 658 21.1 register descriptions the on-chip clock pulse generator has the following registers. ? system clock control register (sckcr) ? system clock control register 2 (sckcr2) (supported only by the h8s/2264 series) ? low-power control register (lpwrcr) 21.1.1 system clock control register (sckcr) sckcr performs medium-speed mode control. bit bit name initial value r/w description 7 6 ? ? 0 0 r/w r/w reserved these are readable/writable bits, but the write value should always be 0. 5 4 ? ? 0 0 ? ? reserved these bits are always read as 0.writing is invalid. 3? 0 r/wreserved this is a readable/writable bit, but the write value should always be 0. 2 1 0 sck2 sck1 sck0 0 0 0 r/w r/w r/w system clock select 2 to 0 these bits select the bus master clock. 000: high-speed mode 001: medium-speed clock is /2 010: medium-speed clock is /4 011: medium-speed clock is /8 100: medium-speed clock is /16 101: medium-speed clock is /32 11x: setting prohibited legend x: don?t care 21.1.2 system clock control register 2 (sckcr2) (supported only by the h8s/2264 series) sckcr2 controls output clock , selects rxd1 input pin, and tcnt_1 input subclock of wdt_1.
rev. 2.0, 09/02, page 510 of 658 bit bit name initial value r/w description 7 phoe 0 r/w clock output enable controls clock output from the ph4 selected by the bits phck3 to phck0. for details, see table 21.1. 6 rxd1s 0 r/w rxd1 select selects the rxd1 input pin. 0: the rxd1 signal is input from the p34. 1: the rxd1 signal is input from the ph5. 5 4 subcks1 subcks0 0 0 r/w r/w prescaler subclock select 1, 0 these bits select the tcnt_1 input subclock source of wdt_1. 00: clock sub 01: clock sub /4 10: clock sub /60 11: setting prohibited 3 2 1 0 phck3 phck2 phck1 phck0 0 0 0 0 r/w r/w r/w r/w clock select 3 to 0 these bits select the clock output from the ph4. for details, see table 21.2. note: * to change the clock output selection, bits phck3 to phck0 must be set after clock output is halted by wiring 0 to the phoe bit. table 21.1 clock output control phoe 0 1 phck3 ? 0 1 subactive mode, subsleep mode, watch mode ph4 i/o fixed to high output high-speed mode, medium-speed mode, sleep mode ph4 i/o output software standby mode, direct transition ph4 i/o fixed to high hardware standby mode high impedance high impedance
rev. 2.0, 09/02, page 511 of 658 table 21.2 clock selection tcsr_1 sckcr2 bit 4 bit 3 bit 2 bit 1 bit 0 main clock frequency subclock frequency 32.768 khz pss phck 3 phck 2 phck 1 phck 0 ph4 output clock 2 mhz 20 mhz sub * 2 sub /4 * 2 sub /60 * 2 0 /1 2 mhz 20 mhz ? ? ? 0 1 /2 1 mhz 10 mhz ? ? ? 0 /8 250 khz 2.5 mhz ? ? ? 0 1 1 /64 31 khz 313 khz ? ? ? 0 /512 3.9 hz 39 khz ? ? ? 0 1 /2048 1.0 khz 10 khz ? ? ? 0 /8192 244 hz 2.4 khz ? ? ? x0 1 1 1 /131072 15 hz 153 hz ? ? ? 0 sub /2 ? 16.38 khz 4.096 khz 273 hz 0 1 sub /4 ? 8.192 khz 2.048 khz 137 hz 0 sub /8 ? 4.096 khz 1.024 khz 68 hz 0 1 1 sub /16 ? 2.048 khz 512 hz 34 hz 0 sub /32 ? 1.024 khz 256 hz 17 hz 0 1 sub /64 ? 512 hz 128 hz 8.5 hz 0 sub /128 ? 256 hz 64 hz 4.3 hz 1 * 1 1 1 1 1 sub /256 ? 128 hz 32 hz 2.1 hz legend x: don?t care notes: 1. to output sub /2 to sub /256, the pss bit in tcsr_1 of wdt_1 must be set to 1. 2. the subclock frequencies of sub , sub /4, and sub /60 are set by the subcks1 and subcks0 bits in sckcr2.
rev. 2.0, 09/02, page 512 of 658 21.1.3 low-power control register (lpwrcr) lpwrcr performs down-mode control, selects sampling frequency for eliminating noise, performs subclock generation control, and specifies multiplication factor. bit bit name initial value r/w description 7 dton 0 r/w direct transition on flag 0: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts to sleep mode, software standby mode, or watch mode. when the sleep instruction is executed in sub- active mode, operation shifts to sub-sleep mode or watch mode. 1: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts directly to sub-active mode, or shifts to sleep mode or software standby mode. when the sleep instruction is executed in sub- active mode, operation shifts directly to high-speed mode, or shifts to sub-sleep mode. 6 lson 0 r/w low speed on fag 0: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts to sleep mode, software standby mode, or watch mode *. when the sleep instruction is executed in sub- active mode, operation shifts to watch mode * or shifts directly to high-speed mode. operation shifts to high-speed mode when watch mode is cancelled. 1: when the sleep instruction is executed in high- speed mode, operation shifts to watch mode or sub-active mode. when the sleep instruction is executed in sub- active mode, operation shifts to sub-sleep mode or watch mode. operation shifts to sub-active mode when watch mode is cancelled.
rev. 2.0, 09/02, page 513 of 658 bit bit name initial value r/w description 5 nesel 0 r/w noise elimination sampling frequency select this bit selects the sampling frequency of the subclock ( sub ) generated by the subclock oscillator is sampled by the clock ( ) generated by the system clock oscillator set 0 when is 5 mhz or higher. set 1 when is 2.1 mhz or lower. any value can be set when is 2.1 to 5 mhz. 0: sampling using 1/32 x 1: sampling using 1/4 x 4 substp 0 r/w subclock enable this bit enables/disables subclock generation. this bit should be set to 1 when subclock is not used. 0: enables subclock generation. 1: disables subclock generation. 3 rfcut 0 r/w (h8s/2268, h8s/2266, h8s/2265, h8s/2264, and h8s/2262) oscillation circuit feedback resistance control bit selects whether or not built-in feedback resistance and duty adjustment circuit of the system clock generator are used when an external clock is input. do not access when the crystal resonator is used. after setting this bit in the external clock input state, enter software standby mode, watch mode, or subactive mode. when software standby mode, watch mode, or subactive mode is entered, switch whether or not built-in feedback resistance and duty adjustment circuit are used. 0: built-in feedback resistance and duty adjustment circuit of the system clock generator used. 1: built-in feedback resistance and duty adjustment circuit of the system clock generator not used. (h8s/2264r and h8s/2262r) reserved this is a readable/writable bit, but the write value should always be 0. 2? 0 r/wreserved this is a readable/writable bit, but the write value should always be 0.
rev. 2.0, 09/02, page 514 of 658 bit bit name initial value r/w description 1 0 stc1 stc0 0 0 r/w r/w multiplication factor setting specifies multiplication factor of the pll circuit built in the evaluation chip. the specified multiplication factor becomes valid software standby mode, watch mode, or subactive mode is entered. these bits should be set to 11 in this lsi. since the value becomes stc1 = stc0 = 0 after a reset, set stc1 = stc0 = 1. 00: x 1 01: x 2 (setting prohibited) 10: x 4 (setting prohibited) 11: pll is bypass note: * when watch mode or subactive mode is entered, set high-speed mode. 21.2 system clock oscillator system clock pulses can be supplied by connecting a crystal resonator, or by input of an external clock. 21.2.1 connecting a crystal resonator a crystal resonator can be connected as shown in the example in figure 21.3. select the damping resistance r d according to table 21.3. an at-cut parallel-resonance crystal should be used. extal xtal r d c l2 c l1 c l1 = c l2 = 10 to 22pf note: c l1 and c l2 are reference values including the floating capacitance of the board. figure 21.3 connection of crystal resonator (example)
rev. 2.0, 09/02, page 515 of 658 table 21.3 damping resistance value frequency (mhz)246810121620 r d ( ? ) 1 k 500 300 200 100 0 0 0 figure 21.4 shows the equivalent circuit of the crystal resonator. use a crystal resonator that has the characteristics shown in table 21.4. xtal c l at-cut parallel-resonance type extal c 0 lr s figure 21.4 crystal resonator equivalent circuit table 21.4 crystal resonator characteristics frequency (mhz)246810121620 r s max ( ? ) 500 120 100 80 60 60 50 40 c 0 max (pf) 77777777 21.2.2 connecting a ceramic resonator a ceramic resonator can be connected in the h8s/2264r and h8s/2262r as shown in the example in figure 21.5. extal xtal c l2 c l1 oscillation frequency preliminary note: * cl1 and cl2 are recommended values including the floating capacitance of the board. cl1, cl2 recommended values t.b.d t.b.d figure 21.5 connection of ceramic resonator (example)
rev. 2.0, 09/02, page 516 of 658 21.2.3 external clock input external clock input is supported by the h8s/2268, h8s/2266, h8s/2265, h8s/2264, and h8s/2262. an external clock signal can be input as shown in the examples in figure 21.6. if the xtal pin is left open, ensure that stray capacitance does not exceed 10 pf. when complementary clock is input to the xtal pin, the external clock input should be fixed high in standby mode, subactive mode, subsleep mode, or watch mode. extal xtal extal xtal external clock input open external clock input (a) xtal pin left open (b) complementary clock input at xtal pin figure 21.6 external clock input (examples) table 21.5 shows the input conditions for the external clock. table 21.6 shows the input conditions for the external clock when duty adjustment circuit is not used. table 21.5 external clock input conditions v cc = 2.7 v to 5.0 v v cc = 4.0 v to 5.5 v item symbol min max min max unit test conditions external clock input low pulse width t exl 30 ? 20 ? ns external clock input high pulse width t exh 30 ? 20 ? ns external clock rise time t exr ?7 ?5 ns external clock fall time t exf ?7 ?5 ns figure 21.7
rev. 2.0, 09/02, page 517 of 658 table 21.6 external clock input conditions (duty adjustment circuit not used) v cc = 2.7 v to 5.0 v v cc = 4.0 v to 5.5 v item symbol min max min max unit test conditions external clock input low pulse width t exl 37 ? 25 ? ns external clock input high pulse width t exh 37 ? 25 ? ns external clock rise time t exr ?7 ?5 ns external clock fall time t exf ?7 ?5 ns figure 21.7 note: when duty adjustment circuit is not used, maximum operating frequency is lowered according to the input waveform. (example: when t exl = t exh = 50 ns, t exr = t exf = 10 ns, clock cycle time = 120 ns, and maximum operating frequency = 8.3 mhz) t exh t exl t exr t exf v cc 0.5 extal figure 21.7 external clock input timing 21.2.4 notes on switching external clock when two or more external clocks (e.g.: 10 mhz and 2 mhz) are used as the system clock, input clock should be switched in software standby mode. an example of external clock switching circuit is shown in figure 21.8. an example of external clock switching timing is shown in figure 21.9.
rev. 2.0, 09/02, page 518 of 658 this lsi port output external interrupt extal external clock 1 external clock 2 selector control circuit external clock switch request external interrupt signal external clock switch signal figure 21.8 external clock switching circuit (examples) 200ns or more (2) (1) port output (clock switching) (2) transition to software standby mode (3) external clock switchover (4) external interrupt generation (an interrupt should be input 200 ns or more after transition to software standby mode.) (5) interrupt exception handling (5) sleep instruction execution interrupt exception handling operation external clock 1 external clock 2 (1) port output (3) external clock switching circuit extal internal clock ? (4) standby mode external interrupt active (external clock1) active (external clock2) software standby mode clock switching request figure 21.9 external clock switching timing (examples)
rev. 2.0, 09/02, page 519 of 658 21.3 duty adjustment circuit the duty adjustment circuit is valid when oscillation frequency is more than 5 mhz. the duty adjustment circuit adjusts clock output fr/m the system clock oscillator to generate the system clock ( ). 21.4 medium-speed clock divider the medium-speed clock divider divides the system clock to generate /2, /4, /8, /16, and /32. 21.5 bus master clock selection circuit the bus master clock selection circuit selects the clock supplied to the bus master by setting the bits sck2 to sck0 in sckcr. the bus master clock can be selected from system clock ( ), or medium-speed clocks ( /2, /4, /8, /16, /32). 21.6 subclock oscillator 21.6.1 connecting 32.768khz crystal resonator to supply a clock to the subclock divider, connect a 32.768khz crystal resonator, as shown in figure 21.10. figure 21.11 shows the equivalence circuit for a 32.768khz oscillator. osc1 osc2 c 1 c 2 c 1 = c 2 = 15pf (typ) note: c1 and c2 are reference values including the floating capacitance of the boad. figure 21.10 example connection of 32.768khz quartz oscillator
rev. 2.0, 09/02, page 520 of 658 osc1 osc2 c s l s r s c o co = 1.5pf (typ.) rs = 14k (typ.) fw = 32.768khz type name = c001r (seiko epson) figure 21.11 equivalence circuit for 32.768khz oscillator 21.6.2 handling pins when subclock not required if no subclock is required, connect the osc1 pin to vss and leave osc2 open, as shown in figure 21.12. set the substp bit of lpwrcr to 1. osc1 osc2 open note: set the substp bit in lpwrcr to 1. figure 21.12 pin handling when subclock not required
rev. 2.0, 09/02, page 521 of 658 21.7 subclock waveform generation circuit to eliminate noise from the subclock input to osci, the subclock is sampled using the dividing clock . the sampling frequency is set using the nesel bit of lpwrcr. for details, see section 21.1.3, low power control register (lpwrcr). no sampling is performed in sub-active mode, sub-sleep mode, or watch mode. 21.8 usage notes 21.8.1 note on crystal resonator as various characteristics related to the crystal resonator are closely linked to the user's board design, thorough evaluation is necessary on the user's part, using the resonator connection examples shown in this section as a guide. as the resonator circuit ratings will depend on the floating capacitance of the resonator and the mounting circuit, the ratings should be determined in consultation with the resonator manufacturer. the design must ensure that a voltage exceeding the maximum rating is not applied to the oscillator pin. 21.8.2 note on board design when designing the board, place the crystal resonator (ceramic resonator) and its load capacitors as close as possible to the xtal and extal pins. make wires as short as possible. other signal lines should be routed away from the oscillator circuit, as shown in figure 21.13. this is to prevent induction from interfering with correct oscillation. c2 avoid signal a signal b c1 this lsi xtal, osc2 extal, osc1 figure 21.13 note on board design of oscillator circuit 21.8.3 note on using a crystal resonator (except for a ceramic resonator) when a microcomputer runs, internal power supply potential will fluctuate synchronized with the system clock. in addition, according to the individual characteristics of crystal resonator, there is a case where the amplitude of the oscillation waveform will not be grown sufficiently immediately after oscillation stabilization period, thus the oscillation waveform is easily affected by the
rev. 2.0, 09/02, page 522 of 658 fluctuation of the power supply voltage. in this condition, oscillation waveform will be unstable, resulting in the system clock instability and malfunction of the microcomputer. if a malfunction occurs, the setting of the standby timer select 2 to 0 (sts2 to sts0) bits in the standby control register (sbycr) must be set so as for the standby time to be longer. for example, if a malfunction occurs when the standby time is set to 8192 states, the operation should be confirmed by setting the standby time to 16384 states or longer. in addition, if a malfunction similar to at state transition occurs at reset, the res pin hold time must be set longer.
rev. 2.0, 09/02, page 523 of 658 section 22 power-down modes in addition to the normal program execution state, the h8s/2268 series and the h8s/2264 series have nine power-down modes in which operation of the cpu and oscillator is halted and power dissipation is reduced. low-power operation can be achieved by individually controlling the cpu, on-chip peripheral modules, and so on. the h8s/2268 series and the h8s/2264 series operating modes are as follows: 1. high-speed mode 2. medium-speed mode 3. subactive mode 4. sleep mode 5. subsleep mode 6. watch mode 7. module stop mode 8. software standby mode 9. hardware standby mode 2. to 9. are low power dissipation states. sleep mode and sub-sleep mode are cpu states, medium- speed mode is a cpu and bus master state, sub-active mode is a cpu and bus master and internal peripheral function state, and module stop mode is an internal peripheral function (including bus masters other than the cpu) state. some of these states can be combined. after a reset, the lsi is in high-speed mode with modules other than the dtc in module stop mode. table 22.1 shows the internal state of the lsi in the respective modes. table 22.2 shows the conditions for shifting between the low power dissipation modes. figure 22.1 is a mode transition diagram. table 22.1 lsi internal states in each mode function high- speed medium- speed sleep module stop watch sub- active subsleep software standby hardware standby system clock pulse generator function- ing function- ing function- ing function- ing halted halted halted halted halted subclock pulse generator function- ing/halted function- ing/halted function- ing/halted function- ing/halted function- ing function- ing function- ing function- ing/halted halted
rev. 2.0, 09/02, page 524 of 658 function high- speed medium- speed sleep module stop watch sub- active subsleep software standby hardware standby cpu instructions function- ing medium- speed operation halted function- ing halted subclock operation halted halted halted registers retained retained retained retained undefined ram function- ing function- ing function- ing (dtc) * 2 function- ing retained function- ing retained retained retained i/o function- ing function- ing function- ing function- ing retained function- ing function- ing halted high impedance external interrupts nmi irqn wkpn function- ing function- ing function- ing function- ing function- ing function- ing function- ing function- ing halted peripheral functions pbc * 2 function- ing medium- speed operation function- ing function- ing/halted (retained) halted (retained) subclock operation halted (retained) halted (retained) halted (reset) dtc * 2 function- ing medium- speed operation function- ing function- ing/halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) halted (reset) tmr_4 * 2 lcd function- ing function- ing function- ing function- ing/halted (retained) subclock operation * 1 subclock operation * 1 subclock operation * 1 halted (retained) halted (reset) wdt_1 function- ing function- ing function- ing function- ing subclock operation * 1 subclock operation * 1 subclock operation * 1 halted (retained) halted (reset) wdt_0 function- ing function- ing function- ing function- ing halted (retained) subclock operation subclock operation halted (retained) halted (reset) tmr_0 tmr_1 tmr_2 * 2 tmr_3 * 2 function- ing function- ing function- ing function- ing/halted (retained) halted (retained) subclock operation subclock operation halted (retained) halted (reset) tpu sci iic dtmf * 2 d/a * 2 function- ing function- ing function- ing function- ing/halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) halted (reset) a/d function- ing function- ing function- ing function- ing/halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) notes: ?halted (retained)? means that internal register values are retained. the internal state is ?operation suspended.? ?halted (reset)? means that internal register values and internal states are initialized. in module stop mode, only modules for which a stop setting has been made are halted (reset or retained). 1. when the tmr_4 * 2 , wdt_1, or lcd is operated in watch, subactive, or subsleep mode, select the subclock as the clock to be used. 2. supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 525 of 658 program-halted state program execution state sck2 to sck0= 0 sck2 to sck0 0 sleep instruction ssby = 1, pss = 1 dton = 1, lson = 1 clock switching exception processing sleep instruction ssby = 1, pss = 1 dton = 1, lson = 0 after the oscillation settling time (sts2 to 0), clock switching exception processing sleep instruction sleep instruction external interrupt * 4 any interrupt * 3 sleep instruction sleep instruction sleep instruction interrupt * 1 lson bit = 0 interrupt * 2 interrupt * 1 lson bit = 1 stby pin = high res pin = low stby pin = low ssby= 0, lson= 0 ssby= 1, pss= 0, lson= 0 ssby= 0, pss= 1, lson= 1 ssby= 1, pss= 1, dton= 0 res pin = high : transition after exception processing : low power dissipation mode reset state high-speed mode (main clock) medium-speed mode (main clock) sub-active mode (subclock) sub-sleep mode (subclock) hardware standby mode software standby mode sleep mode (main clock) watch mode (subclock) notes: 1. 2. 3. 4. h8s/2268 series: nmi, irq0, irq1, irq3 to irq5, wkp0 to wkp7, wdt1 interrupt, and tmr4 interrupt h8s/2264 series: nmi, irq0, irq1, irq3, irq4, wkp0 to wkp7, and wdt1 interrupt h8s/2268 series: nmi, irq0, irq1, irq3 to irq5, wkp0 to wkp7, wdt0 interrupt, wdt1 interrupt, and tmr0 to tmr4 interrupts h8s/2264 series: nmi, irq0, irq1, irq3, irq4, wkp0 to wkp7, wdt0 interrupt, wdt1 interrupt, tmr0 interrupt, and tmr1 interrupt all interrupts h8s/2268 series: nmi, irq0, irq1, irq3 to irq5, wkp0 to wkp7 h8s/2264 series: nmi, irq0, irq1, irq3, irq4, wkp0 to wkp7 ? when a transition is made between modes by means of an interrupt, the transition cannot be made on interrupt source generation alone. ensure that interrupt handling is performed after accepting the interrupt request.  from any state except hardware standby mode, a transition to the reset state occurs when is driven low.  from any state, a transition to hardware standby mode occurs when is driven low.  always select high-speed mode before making a transition to watch mode or sub-active mode. figure 22.1 mode transition diagram
rev. 2.0, 09/02, page 526 of 658 table 22.2 low power dissipation mode transition conditions status of control bit at transition pre-transition state ssby pss lson dton state after transition invoked by sleep instruction state after transition back from low power mode invoked by interrupt 0 x 0 x sleep high-speed/medium-speed high-speed/ medium-speed 0x1x? ? 100xsoftware standby high-speed/medium-speed 101x? ? 1100watch high-speed 1110watch sub-active 1101? ? 1111sub-active ? sub-active 0 0 x x ? ? 010x? ? 011xsub-sleep sub-active 1 0 xx? ? 1100watch high-speed 1110watch sub-active 1101high-speed ? 1111? ? legend x : don?t care ?: do not set. 22.1 register description the following registers relates to the power-down modes. for details on system clock control register (sckcr), refer to section 21.1.1, system clock control register (sckcr). for details on low power control register (lpwrcr), refer to section 21.1.3, low power control register (lpwrcr). for details on timer control status register (tcsr), refer to section 12.2.2, timer control status register (tcsr). ? standby control register (sbycr) ? module stop control register a (mstpcra) ? module stop control register b (mstpcrb) ? module stop control register c (mstpcrc) ? module stop control register d (mstpcrd)
rev. 2.0, 09/02, page 527 of 658 ? low power control register (lpwrcr) ? system clock control register (sckcr) ? timer control status register (tcsr) 22.1.1 standby control register (sbycr) sbycr performs power-down mode control. bit bit name initial value r/w description 7 ssby 0 r/w software standby specifies transition destination when the sleep instruction is executed. 0: shifts to sleep mode when the sleep instruction is executed in high-speed mode or medium-speed mode. shifts to sub-sleep mode when the sleep instruction is executed in sub-active mode. 1: shifts to software standby mode, sub-active mode, and watch mode when the sleep instruction is executed in high-speed mode or medium-speed mode. shifts to watch mode or high-speed mode when the sleep instruction is executed in sub-active mode. note that the value of the ssby bit does not change even when software standby mode is canceled and making normal operation mode transition by executing an external interrupt. to clear this bit, 0 should be written to.
rev. 2.0, 09/02, page 528 of 658 bit bit name initial value r/w description 6 5 4 sts2 sts1 sts0 0 0 0 r/w r/w r/w standby timer select 2 to 0 these bits select the mcu wait time for clock settling to cancel software standby mode, watch mode, or sub-active mode. (normal oscillation: h8s/2268, h8s/2266, h8s/2265, h8s/2264, and h8s/2262) with a crystal resonator (table 22.3), select a wait time of 8 ms (oscillation settling time) or more, depending on the operating frequency. with an external clock, there are no specific wait requirements. 000: standby time = 8192 states 001: standby time = 16384 states 010: standby time = 32768 states 011: standby time = 65536 states 100: standby time = 131072 states 101: standby time = 262144 states 110: standby time = 2048 states 111: standby time = 16 states * (oscillation settling time shortened: h8s/2264r and h8s/2262r) with a crystal resonator or ceramic resonator, refer to tables 22.4 and 22.5 and select a wait time of tbd s (oscillation settling time) or more, depending on the operating frequency. an external clock cannot be used. 000: standby time = 8192 states 001: standby time = 16384 states 010: standby time = 256 states 011: standby time = 512 states 100: standby time = 1024 states 101: standby time = 4096 states 110: standby time = 2048 states 111: reserved 3 ? 1 r/w reserved this is a readable/writable bit, but the write value should always be 1.
rev. 2.0, 09/02, page 529 of 658 bit bit name initial value r/w description 2 to 0 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. note: * do not set 16 states for standby time in the version with built-in flash memory. 2048 states or more should be set. 22.1.2 module stop control registers a to d (mstpcra to mstpcrd) mstpcr performs module stop mode control. when bits in mstpcr registers are set to 1, module stop mode is set. when cleared to 0, module stop mode is cleared. mstpcra bit bit name initial value r/w target module 7 mstpa7 * 1 0 r/w 6 mstpa6 * 2 0 r/w data transfer controller (dtc) 5 mstpa5 1 r/w 16-bit timer pulse unit (tpu) 4 mstpa4 1 r/w 8-bit timer (tmr_0, tmr_1) 3 mstpa3 * 1 1 r/w 2 mstpa2 * 1 1 r/w 1 mstpa1 1 r/w a/d converter 0 mstpa0 * 2 1 r/w 8-bit timer (tmr_2, tmr_3) mstpcrb bit bit name initial value r/w target module 7 mstpb7 1 r/w serial communication interface 0 (sci_0) 6 mstpb6 1 r/w serial communication interface 1 (sci_1) 5 mstpb5 * 1 1 r/w 4 mstpb4 1 r/w i 2 c bus interface 0 (i 2 c_0) (optional) 3 mstpb3 * 2 1 r/w i 2 c bus interface 1 (i 2 c_1) (optional) 2 mstpb2 * 1 1 r/w 1 mstpb1 * 1 1 r/w 0 mstpb0 * 1 1 r/w
rev. 2.0, 09/02, page 530 of 658 mstpcrc bit bit name initial value r/w target module 7 mstpc7 1 r/w serial communication interface 2 (sci_2) 6 mstpc6 * 1 1 r/w 5 mstpc5 * 2 1 r/w d/a converter 4 mstpc4 * 2 1 r/w pc break controller (pbc) 3 mstpc3 * 1 1 r/w 2 mstpc2 * 2 1 r/w dtmf generation circuit 1 mstpc1 * 1 1 r/w 0 mstpc0 * 1 1 r/w mstpcrd bit bit name initial value r/w target module 7 mstpd7 * 1 1 r/w 6 mstpd6 1 r/w lcd controller/driver 5 mstpd5 * 2 1 r/w 8-bit reload timer (tmr_4) 4 mstpd4 * 1 1 r/w 3 mstpd3 * 1 1 r/w 2 mstpd2 * 1 1 r/w 1 mstpd1 * 1 1 r/w 0 mstpd0 * 1 1 r/w notes: 1. bit mstpa7 can be read/written to. this bit is initialized to 0. only 1 should be written to. bits mstpa3, mstpa2, mstpb5, mstpb2 to mstpb0, mstpc6, mstpc3, mstpc1, mstpc0, mstpd7, mstpd4 to mstpd0 can be read/written to. these bits are initialized to 1. only 1 should be written to. 2. with the h8s/2264 series, only 1 should be written to.
rev. 2.0, 09/02, page 531 of 658 22.2 medium-speed mode in high-speed mode, when the sck2 to sck0 bits in sckcr are set to 1, the operating mode changes to medium-speed mode as soon as the current bus cycle ends. in medium-speed mode, the cpu operates on the operating clock ( /2, /4, /8, /16, or /32) specified by the sck2 to sck0 bits. the bus masters other than the cpu (dtc*) also operate in medium-speed mode. on-chip peripheral modules other than the bus masters always operate on the high-speed clock ( ). in medium-speed mode, a bus access is executed in the specified number of states with respect to the bus master operating clock. for example, if /4 is selected as the operating clock, on-chip memory is accessed in 4 states, and internal i/o registers in 8 states. medium-speed mode is cleared by clearing all of bits sck2 to sck0 to 0. a transition is made to high-speed mode and medium-speed mode is cleared at the end of the current bus cycle. if a sleep instruction is executed when the ssby bit in sbycr is cleared to 0, and lson bit in lpwrcr is cleared to 0, a transition is made to sleep mode. when sleep mode is cleared by an interrupt, medium-speed mode is restored. when the sleep instruction is executed with the ssby bit = 1, lpwrcr lson bit = 0, and tcsr (wdt_1) pss bit = 0, operation shifts to the software standby mode. when software standby mode is cleared by an external interrupt, medium-speed mode is restored. when the res pin is set low and medium-speed mode is cancelled, operation shifts to the reset state. the same applies in the case of a reset caused by overflow of the watchdog timer. when the stby pin is driven low, a transition is made to hardware standby mode. figure 22.2 shows the timing for transition to and clearance of medium-speed mode. note: supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 532 of 658 internal clock , bus master clock peripheral module clock internal address bus internal write signal medium-speed mode sbycr sbycr figure 22.2 medium-speed mode transition and clearance timing 22.3 sleep mode 22.3.1 sleep mode when the sleep instruction is executed while the sbycr ssby bit = 0 and the lpwrcr lson bit = 0, the cpu enters the sleep mode. in sleep mode, cpu operation stops but the contents of the cpu?s internal registers are retained. other peripheral modules do not stop. 22.3.2 exiting sleep mode sleep mode is exited by any interrupt, or signals at the res , or stby pins. ? exiting sleep mode by interrupts when an interrupt occurs, sleep mode is exited and interrupt exception processing starts. sleep mode is not exited if the interrupt is disabled, or interrupts other than nmi are masked by the cpu. ? exiting sleep mode by res pin setting the res pin level low selects the reset state. after the stipulated reset input duration, driving the res pin high starts the cpu performing reset exception processing. ? exiting sleep mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode.
rev. 2.0, 09/02, page 533 of 658 22.4 software standby mode 22.4.1 software standby mode a transition is made to software standby mode when the sleep instruction is executed while the sbycr ssby bit = 1 and the lpwrcr lson bit = 0, and the tcsr (wdt_1) pss bit = 0. in this mode, the cpu, on-chip peripheral modules, and oscillator all stop. however, the contents of the cpu?s internal registers, ram data, and the states of on-chip peripheral modules other than the a/d converter, and the states of i/o ports are retained. in this mode the oscillator stops, and therefore power dissipation is significantly reduced. 22.4.2 clearing software standby mode software standby mode is cleared by an external interrupt (nmi pin, or pins irq0 , irq1 , irq3 , irq4 , irq5 *, wkp0 to wkp7 ), or by means of the res pin or stby pin. ? clearing with an interrupt when an nmi, or irq0, irq1, irq3, irq4, irq5*, or wkp0 to wkp7 interrupt request signal is input, clock oscillation starts, and after the elapse of the time set in bits sts2 to sts0 in syscr, stable clocks are supplied to the entire chip, software standby mode is cleared, and interrupt exception handling is started. when clearing software standby mode with an irq0, irq1, irq3, irq4, irq5*, or wkp0 to wkp7 interrupt, set the corresponding enable bit/pin function switching bit to 1 and ensure that no interrupt with a higher priority than interrupts irq0, irq1, irq3, irq4, irq5*, or wkp0 to wkp7 is generated. software standby mode cannot be cleared if the interrupt has been masked on the cpu side or has been designated as a dtc activation source. ? clearing with the res pin when the res pin is driven low, clock oscillation is started. at the same time as clock oscillation starts, clocks are supplied to the entire chip. note that the res pin must be held low until clock oscillation settles. when the res pin goes high, the cpu begins reset exception handling. ? clearing with the stby pin when the stby pin is driven low, a transition is made to hardware standby mode. note: supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 534 of 658 22.4.3 oscillation settling time after clearing software standby mode bits sts2 to sts0 in sbycr should be set as described below. normal oscillation (h8s/2268, h8s/2266, h8s/2265, h8s/2264, and h8s/2262): ? using a crystal oscillator set bits sts2 to sts0 so that the standby time is at least 8 ms (the oscillation settling time). table 22.3 shows the standby times for different operating frequencies and settings of bits sts2 to sts0. ? using an external clock any value can be set. normally, minimum time is recommended. note: do not set 16 states for standby time in the version with built-in flash memory. 2048 states or more should be set. table 22.3 oscillation settling time settings (normal oscillation) sts2 sts1 sts0 standby time 20 mhz 16 mhz 13 mhz 10 mhz 8 mhz 6 mhz 4 mhz 2 mhz unit 0 0 0 8192 states 0.41 0.51 0.63 0.82 1.0 1.4 2.0 4.1 ms 1 16384 states 0.82 1.0 1.3 1.6 2.0 2.7 4.1 8.2 1 0 32768 states 1.6 2.0 2.5 3.3 4.1 5.5 8.2 16.4 1 65536 states 3.3 4.1 5.0 6.6 8.2 10.9 16.4 32.8 1 0 0 131072 states 6.6 8.2 10.1 13.1 16.4 21.8 32.8 65.5 1 262144 states 13.1 16.4 20.2 26.2 32.8 43.7 65.5 131.1 1 0 2048 states 0.10 0.13 0.16 0.20 0.26 0.34 0.51 1.0 1 16 states 0.8 1.0 1.2 1.6 2.0 2.7 4.0 8.0 s shading: recommended time setting oscillation settling time shortened (h8s/2264r and h8s/2262r) ? ? ? ? preliminary ? ? ? ? : ? using a crystal oscillator set bits sts2 to sts0 so that the standby time is at least tbd s (the oscillation settling time). table 22.4 shows the standby times for different operating frequencies and settings of bits sts2 to sts0. ? using a ceramic oscillator table 22.5 shows the standby times for different operating frequencies and settings of bits sts2 to sts0. note: an external clock cannot be used in the h8s/2264r and h8s/2262r.
rev. 2.0, 09/02, page 535 of 658 table 22.4 oscillation settling time settings (oscillation settling time shortened: crystal oscillator) sts2 sts1 sts0 standby time 20 mhz 16 mhz 13 mhz 10 mhz 8 mhz 6 mhz 4 mhz 2 mhz unit 0 1 0 256 states 12.8 16.0 19.7 25.6 32.0 42.7 64.0 128 s 0 1 1 512 states 25.6 32.0 39.4 51.2 64.0 85.3 128 256 1 0 0 1024 states 51.2 64.0 78.8 102 128 171 256 512 1 1 0 2048 states 102 128 158 205 256 341 512 1024 1 0 1 4096 states 205 256 315 410 512 683 1024 2048 0 0 0 8192 states 410 512 630 819 1024 1365 2048 4096 0 0 1 16384 states 819 1024 1260 1638 2048 2731 4096 8192 111reserved ????????? table 22.5 oscillation settling time settings (oscillation settling time shortened: ceramic oscillator) sts2 sts1 sts0 standby time 20 mhz 16 mhz 13 mhz 10 mhz 8 mhz 6 mhz 4 mhz 2 mhz unit 0 1 0 256 states 12.8 16.0 19.7 25.6 32.0 42.7 64.0 128 s 0 1 1 512 states 25.6 32.0 39.4 51.2 64.0 85.3 128 256 1 0 0 1024 states 51.2 64.0 78.8 102 128 171 256 512 1 1 0 2048 states 102 128 158 205 256 341 512 1024 1 0 1 4096 states 205 256 315 410 512 683 1024 2048 0 0 0 8192 states 410 512 630 819 1024 1365 2048 4096 0 0 1 16384 states 819 1024 1260 1638 2048 2731 4096 8192 111reserved ????????? shading: recommended time setting 22.4.4 software standby mode application example figure 22.3 shows an example in which a transition is made to software standby mode at the falling edge on the nmi pin, and software standby mode is cleared at the rising edge on the nmi pin. in this example, an nmi interrupt is accepted with the nmieg bit in syscr cleared to 0 (falling edge specification), then the nmieg bit is set to 1 (rising edge specification), the ssby bit is set to 1, and a sleep instruction is executed, causing a transition to software standby mode. software standby mode is then cleared at the rising edge on the nmi pin.
rev. 2.0, 09/02, page 536 of 658 oscillator internal clock nmi nmieg ssby nmi exception handling nmieg=1 ssby=1 sleep instruction software standby mode (power-down mode) oscillation settling time t osc2 nmi exception handling figure 22.3 software standby mode application example 22.5 hardware standby mode 22.5.1 hardware standby mode when the stby pin is driven low, a transition is made to hardware standby mode from any mode. in hardware standby mode, all functions enter the reset state and stop operation, resulting in a significant reduction in power dissipation. as long as the prescribed voltage is supplied, on-chip ram data is retained. i/o ports are set to the high-impedance state. do not change the state of the mode pins (md2,md1) during hardware standby mode. 22.5.2 clearing hardware standby mode hardware standby mode is cleared by means of the stby pin and the res pin. when the stby pin is driven high while the res pin is low, the reset state is set and clock oscillation is started. ensure that the res pin is held low until the clock oscillator settles (at least t osc1 ms?the oscillation settling time?when using a crystal/ceramic oscillator). when the res pin is subsequently driven high, a transition is made to the program execution state via the reset exception handling state.
rev. 2.0, 09/02, page 537 of 658 22.5.3 hardware standby mode timing figure 22.4 shows an example of hardware standby mode timing. when the stby pin is driven low after the res pin has been driven low, a transition is made to hardware standby mode. hardware standby mode is cleared by driving the stby pin high, waiting for the oscillation settling time, then changing the res pin from low to high. oscillator res stby oscillation settling time t osc1 reset exception handling figure 22.4 hardware standby mode timing 22.6 module stop mode module stop mode can be set for individual on-chip peripheral modules. when the corresponding mstp bit in mstpcr is set to 1, module operation stops at the end of the bus cycle and a transition is made to module stop mode. the cpu continues operating independently. when the corresponding mstp bit is cleared to 0, module stop mode is cleared and the module starts operating at the end of the bus cycle. in module stop mode, the internal states of modules other than the a/d converter are retained. after reset clearance, all modules other than dtc* are in module stop mode. when an on-chip peripheral module is in module stop mode, read/write access to its registers is disabled. since the operations of the bus controller and i/o port are stopped when sleep mode is entered at the all-module stop state (mstpcr=h'ffffffff), power consumption can further be reduced. note: supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 538 of 658 22.7 watch mode 22.7.1 transition to watch mode cpu operation makes a transition to watch mode when the sleep instruction is executed in high- speed mode or sub-active mode with sbycr ssby=1, lpwrcr dton = 0, and tcsr (wdt_1) pss = 1. in watch mode, the cpu is stopped and peripheral modules other than wdt_1, tmr_4*, and lcd are also stopped. the contents of the cpu?s internal registers, the data in internal ram, and the statuses of the internal peripheral modules (excluding the a/d converter) and i/o ports are retained. to make a transition to watch mode, bits sck2 to sck0 in sckcr must be set to 0. note: supported only by the h8s/2268 series. 22.7.2 exiting watch mode watch mode is exited by any interrupt (wovi1 interrupt, ovi4 to ovi7 interrupts*, nmi pin, or irq0 , irq1 , irq3 , irq4 , irq5 *, or wkp0 to wkp7 ), or signals at the res , or stby pins. ? exiting watch mode by interrupts when an interrupt occurs, watch mode is exited and a transition is made to high-speed mode or medium-speed mode when the lpwrcr lson bit = 0 or to sub-active mode when the lson bit = 1. when a transition is made to high-speed mode, a stable clock is supplied to all lsi circuits and interrupt exception processing starts after the time set in sbycr sts2 to sts0 has elapsed. in the case of irq0, irq1, irq3, irq4, irq5*, and wkp0 to wkp7 interrupts, no transition is made from watch mode if the corresponding enable bit/pin function switching bit has been cleared to 0, and, in the case of interrupts from the internal peripheral modules, the interrupt enable register has been set to disable the reception of that interrupt, or is masked by the cpu. see section 22.4.3, oscillation settling time after clearing software standby mode, for how to set the oscillation settling time when making a transition from watch mode to high-speed mode. ? exiting watch mode by res pins for exiting watch mode by the res pins, see section 22.4.2, clearing software standby mode. ? exiting watch mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode. note: supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 539 of 658 22.8 sub-sleep mode 22.8.1 transition to sub-sleep mode when the sleep instruction is executed with the sbycr ssby bit = 0, lpwrcr lson bit = 1, and tcsr (wdt_1) pss bit = 1, cpu operation shifts to sub-sleep mode. in sub-sleep mode, the cpu is stopped. peripheral modules other than tmr_0, tmr1, tmr2 to tmr_4*, wdt_0, wdt_1, and lcd are also stopped. the contents of the cpu?s internal registers, the data in internal ram, and the statuses of the internal peripheral modules (excluding the a/d converter) and i/o ports are retained. note: supported only by the h8s/2268 series. 22.8.2 exiting sub-sleep mode sub-sleep mode is exited by an interrupt (interrupts from internal peripheral modules, nmi pin, or irq0 , irq1 , irq3 , irq4 , irq5 *, or wkp0 to wkp7 ), or signals at the res or stby pins. ? exiting sub-sleep mode by interrupts when an interrupt occurs, sub-sleep mode is exited and interrupt exception processing starts. in the case of irq0 , irq1 , irq3 , irq4 , irq5 *, and wkp0 to wkp7 interrupts, sub-sleep mode is not cancelled if the corresponding enable bit/pin function switching bit has been cleared to 0, and, in the case of interrupts from the internal peripheral modules, the interrupt enable register has been set to disable the reception of that interrupt, or is masked by the cpu. ? exiting sub-sleep mode by res for exiting sub-sleep mode by the res pins, see section 22.4.2, clearing software standby mode. ? exiting sub-sleep mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode. note: supported only by the h8s/2268 series.
rev. 2.0, 09/02, page 540 of 658 22.9 sub-active mode 22.9.1 transition to sub-active mode when the sleep instruction is executed in high-speed mode with the sbycr ssby bit = 1, lpwrcr dton bit = 1, lson bit = 1, and tcsr (wdt_1) pss bit = 1, cpu operation shifts to sub-active mode. when an interrupt occurs in watch mode, and if the lson bit of lpwrcr is 1, a transition is made to sub-active mode. and if an interrupt occurs in sub-sleep mode, a transition is made to sub-active mode. in sub-active mode, the cpu operates at low speed on the subclock, and the program is executed step by step. peripheral modules other than pbc*, tmr_0, tmr_1, tmr_2 to tmr_4*, wdt_0, wdt_1, and lcd are also stopped. when operating the cpu in sub-active mode, the sckcr sck2 to sck0 bits must be set to 0. note: supported only by the h8s/2268 series. 22.9.2 exiting sub-active mode sub-active mode is exited by the sleep instruction or the res or stby pins. ? exiting sub-active mode by sleep instruction when the sleep instruction is executed with the sbycr ssby bit = 1, lpwrcr dton bit = 0, and tcsr (wdt_1) pss bit = 1, the cpu exits sub-active mode and a transition is made to watch mode. when the sleep instruction is executed with the sbycr ssby bit = 0, lpwrcr lson bit = 1, and tcsr (wdt_1) pss bit = 1, a transition is made to sub-sleep mode. finally, when the sleep instruction is executed with the sbycr ssby bit = 1, lpwrcr dton bit = 1, lson bit = 0, and tcsr (wdt_1) pss bit = 1, a direct transition is made to high-speed mode (sck0 to sck2 all 0). ? exiting sub-active mode by res pins for exiting sub-active mode by the res pins, see section 22.4.2, clearing software standby mode. ? exiting sub-active mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode.
rev. 2.0, 09/02, page 541 of 658 22.10 direct transitions there are three modes, high-speed, medium-speed, and sub-active, in which the cpu executes programs. when a direct transition is made, there is no interruption of program execution when shifting between high-speed and sub-active modes. direct transitions are enabled by setting the lpwrcr dton bit to 1, then executing the sleep instruction. after a transition, direct transition interrupt exception processing starts. 22.10.1 direct transitions from high-speed mode to sub-active mode execute the sleep instruction in high-speed mode when the sbycr ssby bit = 1, lpwrcr lson bit = 1, and dton bit = 1, and tscr (wdt_1) pss bit = 1 to make a transition to sub- active mode. 22.10.2 direct transitions from sub-active mode to high-speed mode execute the sleep instruction in sub-active mode when the sbycr ssby bit = 1, lpwrcr lson bit = 0, and dton bit = 1, and tscr (wdt_1) pss bit = 1 to make a direct transition to high-speed mode after the time set in sbycr sts2 to sts0 has elapsed. 22.11 usage notes 22.11.1 i/o port status in software standby mode and watch mode, i/o port states are retained. therefore, there is no reduction in current dissipation for the output current when a high-level signal is output. 22.11.2 current dissipation during oscillation settling wait period current dissipation increases during the oscillation settling wait period. 22.11.3 dtc module stop (supported only by the h8s/2268 series) depending on the operating status of the dtc, the mstpa6 bit may not be set to 1. setting of the dtc module stop mode should be carried out only when the respective module is not activated. for details, refer to section 8, data transfer controller (dtc).
rev. 2.0, 09/02, page 542 of 658 22.11.4 on-chip peripheral module interrupt ? module stop mode relevant interrupt operations cannot be performed in module stop mode. consequently, if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dtc* activation source. interrupts should therefore be disabled before entering module stop mode. note: supported only by the h8s/2268 series. ? subactive mode / watch mode on-chip peripheral modules (dtc*, tpu, iic) that stop operation in subactive mode cannot clear interrupts in subactive mode. therefore, if subactive mode is entered when an interrupt is requested, cpu interrupt factors cannot be cleared. interrupts should therefore before executing the sleep instruction and entering subactive or watch mode. note: supported only by the h8s/2268 series. 22.11.5 writing to mstpcr mstpcr should only be written to by the cpu. 22.11.6 entering subactive / watch mode and dtc module stop (supported only by the h8s/2268 series) to enter subactive or watch mode, set dtc to module stop (write 1 to the mstpa6 bit) and reading the mstpa6 bit as 1 before transiting mode. after transiting from subactive mode to active mode, clear module stop. when dtc activation factor occurs in subactive mode, dtc is activated when module stop is cleared after active mode is entered.
rev. 2.0, 09/02, page 543 of 658 section 23 power-on reset circuit the h8s/2264 series has a power-on reset circuit. the h8s/2268 series does not have a power-on reset circuit. block diagram of the power-on reset circuit is shown in figure 23.1. 23.1 features ? power-on reset circuit the power-on reset circuit can be enabled or disabled according to the mode pin settings (enabled when md2 = 0 and md1 = 1). an internal reset signal is generated at turning the power on by externally connecting a capacitor. ck md2 md1 legend: ps: prescaler r ps ovf r s q figure 23.1 power-on reset circuit 23.2 operation 23.2.1 power-on reset circuit the power-on reset circuit is enabled by setting the mode pins md2 and md1 to b'01. the operation timing of the power-on reset circuit is shown in figure 23.2. as the power supply voltage rises, the capacitor is gradually charged through the pull-up resistor, which is connected to the res pin. the low level of the res pin is sent to the chip and resets the prescaler and the whole chip. when the level of the res pin reaches to the predetermined level, reset state of the prescaler is cancelled and count-up operation starts. when the prescaler counts for 131,072 times, an ovf signal is generated and an internal reset signal is cancelled. psckt10a_000020020700
rev. 2.0, 09/02, page 544 of 658 note that the power-supply circuit must be designed so that the power supply voltage reaches an appropriate level within the stipulated time. in addition, when the capacitance of the capacitor which is externally connected is determined, the rising time of the power supply voltage level must be taken into consideration. vcc vss vss t poresw * ps reset signal internal reset signal ovf 131,072 states ps counter starts reset cancelled vih figure 23.2 power-on reset circuit operation timing note: * in case of t osc1 131,072 states t poresw t resw in case of t osc1 > 131,072 states t poresw t resw + t ocs1 ? 131,072 states
rev. 2.0, 09/02, page 545 of 658 section 24 power supply circuit this lsi has an internal power step-down circuit built into it. using this circuit allows the internal power supply to be fixed at approximately 3.0 v without relaying on the power supply voltage connected to the external vcc terminal. this means that, when used at an external power supply higher than 3.0 v, the current consumption value can be suppressed to largely the same value as that when used at approximately 3.0 v. if the external voltage is 3.0 v or less, the internal voltage will be largely consistent with the external voltage. 24.1 when the internal power step-down circuit is used as shown in figure 24.1, an external power supply should be connected to the vcc terminal, using the shortest possible wiring, with a capacitance of approximately 0.1 f between cvcc and vss. adding this external circuit makes the internal step-down circuit valid. applying a power supply exceeding the absolute maximum rated value of 4.3 v to the cvcc terminal can permanently damage the lsi, so the power supply should not be connected to the cvcc terminal. the external power supply voltage connected to vcc and the gnd potential connected to vss serve as the references for the input/output levels of the external circuit. for example, a ?high? port input/output level will be the vcc reference, and a ?low? level will be the vss reference. the analog power supplies of the a/d converter, d/a converter*, and dtmf generation circuit* do not affect the internal step-down circuit. note: * supported only by the h8s/2268 series. vss cvcc vcc internal power supply internal logic vcc 2.7 to 5.5v (vcc = 3.0 to 5.5v for the f-ztat version) setup-down voltage circuit stabilized capacitance (approx. 0.1 f) figure 24.1 power supply connections when an internal power supply step-down circuit is used
rev. 2.0, 09/02, page 546 of 658
rev. 2.0, 09/02, page 547 of 658 section 25 list of registers this section gives information on the on-chip i/o registers and is configured as described below. 1. register addresses (by functional module, in address order) ? descriptions by functional module, in ascending order of addresses ? when registers consist of 16 bits, the addresses of the msbs are given. ? data bus width is given. ? the number of access states are given. 2. register bits ? bit configurations of the registers are described in the same order as the register addresses (by functional module, in ascending order of addresses). ? reserved bits are indicated by ? in the bit name. ? when registers consist of 16 or 32 bits, bits are described from the msb side. 3. register states in each operating mode ? register states are described in the same order as the register addresses (by functional module, in ascending order of addresses). ? the register states described are for the basic operating modes. if there is a specific reset for an on-chip module, refer to the section on that on-chip module. 25.1 register addresses (by function module, in address order) the data bus width indicates the numbers of bits by which the register is accessed. the number of access states indicates the number of states based on the specified reference clock.
rev. 2.0, 09/02, page 548 of 658 register name abbrevia- tion bit no. address * 1 module data width access state dtc mode register a * 4 mra 8 h'ebc0 to dtc 16/32 * 2 1 dtc source address register * 4 sar 24 h'efbf dtc 16/32 * 2 1 dtc mode register b * 4 mrb 8 dtc 16/32 * 2 1 dtc destination address register * 4 dar 24 dtc 16/32 * 2 1 dtc transfer count register a * 4 cra 16 dtc 16/32 * 2 1 dtc transfer count register b * 4 crb 16 dtc 16/32 * 2 1 lcd port control register lpcr 8 h'fc30 lcd 8/16 4 lcd control register lcr 8 h'fc31 lcd 8/16 4 lcd control register 2 lcr2 8 h'fc32 lcd 8/16 4 lcd ram ? 8 h'fc40 to h'fc53 lcd 8/16 4 module stop control register d mstpcrd 8 h'fc60 system 8 4 system clock control register 2 * 5 sckcr2 8 h?fc61 system 8 4 dtmf control register * 4 dtcr 8 h'fc68 dtmf 8 4 dtmf load register * 4 dtlr 8 h'fc69 dtmf 8 4 timer control register_4 * 4 tcr_4 8 h'fc70 tmr_4 8/16 4 timer control register_5 * 4 tcr_5 8 h'fc71 tmr_4 8/16 4 timer control register_6 * 4 tcr_6 8 h'fc72 tmr_4 8/16 4 timer control register_7 * 4 tcr_7 8 h'fc73 tmr_4 8/16 4 timer counter 4/timer reload register 4 * 4 tcnt_4(r)/ tlr_4(w) 8 h'fc74 tmr_4 8/16 4 timer counter 5/timer reload register 5 * 4 tcnt_5(r)/ tlr_5(w) 8 h'fc75 tmr_4 8/16 4 timer counter 6/timer reload register 6 * 4 tcnt_6(r)/ tlr_6(w) 8 h'fc76 tmr_4 8/16 4 timer counter 7/timer reload register 7 * 4 tcnt_7(r)/ tlr_7(w) 8 h'fc77 tmr_4 8/16 4 port h data direction register phddr 8 h'fc80 port 8 4
rev. 2.0, 09/02, page 549 of 658 register name abbrevia- tion bit no. address * 1 module data width access state port j data direction register pjddr 8 h'fc81 port 8 4 port k data direction register pkddr 8 h'fc82 port 8 4 port l data direction register plddr 8 h'fc83 port 8 4 port m data direction register * 4 pmddr 8 h'fc84 port 8 4 port n data direction register * 4 pnddr 8 h'fc85 port 8 4 port h data register phdr 8 h'fc88 port 8 4 port j data register pjdr 8 h'fc89 port 8 4 port k data register pkdr 8 h'fc8a port 8 4 port l data register pldr 8 h'fc8b port 8 4 port m data register * 4 pmdr 8 h'fc8c port 8 4 port n data register * 4 pndr 8 h'fc8d port 8 4 port h register porth 8 h'fc90 port 8 4 port j register portj 8 h'fc91 port 8 4 port k register portk 8 h'fc92 port 8 4 port l register portl 8 h'fc93 port 8 4 port m register * 4 portm 8 h'fc94 port 8 4 port n register * 4 portn 8 h'fc95 port 8 4 port j pull-up mos control register pjpcr 8 h'fc99 port 8 4 wakeup control register wpcr 8 h'fc9f port 8 4 wakeup interrupt request register iwpr 8 h'fca0 int 8 4 interrupt enable register ienr1 8 h'fca1 int 8 4 d/a data register_0 * 4 dadr_0 8 h'fdac d/a 8 2 d/a data register_1 * 4 dadr_1 8 h'fdad d/a 8 2 d/a control register * 4 dacr 8 h'fdae d/a 8 2 serial control register x scrx 8 h'fdb4 iic, flash 82 ddc switch register ddcswr 8 h'fdb5 iic 8 2 timer control register_2 * 4 tcr_2 8 h'fdc0 tmr_2 8 2 timer control register_3 * 4 tcr_3 8 h'fdc1 tmr_3 8 2 timer control/status register_2 * 4 tcsr_2 8 h'fdc2 tmr_2 8 2 timer control/status register_3 * 4 tcsr_3 8 h'fdc3 tmr_3 8 2 time constant register a_2 * 4 tcora_2 8 h'fdc4 tmr_2 8/16 2 time constant register a_3 * 4 tcora_3 8 h'fdc5 tmr_3 8/16 2
rev. 2.0, 09/02, page 550 of 658 register name abbrevia- tion bit no. address * 1 module data width access state time constant register b_2 * 4 tcorb_2 8 h'fdc6 tmr_2 8/16 2 time constant register b_3 * 4 tcorb_3 8 h'fdc7 tmr_3 8/16 2 timer counter_2 * 4 tcnt_2 8 h'fdc8 tmr_2 8/16 2 timer counter_3 * 4 tcnt_3 8 h'fdc9 tmr_3 8/16 2 serial mode register_2 smr_2 8 h'fdd0 sci_2 8 2 bit rate register_2 brr_2 8 h'fdd1 sci_2 8 2 serial control register_2 scr_2 8 h'fdd2 sci_2 8 2 transmit data register_2 tdr_2 8 h'fdd3 sci_2 8 2 serial status register_2 ssr_2 8 h'fdd4 sci_2 8 2 receive data register_2 rdr_2 8 h'fdd5 sci_2 8 2 smart card mode register_2 scmr_2 8 h'fdd6 sci_2 8 2 standby control register sbycr 8 h'fde4 system 8 2 system control register syscr 8 h'fde5 system 8 2 system clock control register sckcr 8 h'fde6 system 8 2 mode control register mdcr 8 h'fde7 system 8 2 module stop control register a mstpcra 8 h'fde8 system 8 2 module stop control register b mstpcrb 8 h'fde9 system 8 2 module stop control register c mstpcrc 8 h'fdea system 8 2 low power control register lpwrcr 8 h'fdec system 8 2 serial expansion mode register_0 semr_0 8 h'fdf8 sci_0 8 2 break address register a * 4 bara 32 h'fe00 pbc 8/16 2 break address register b * 4 barb 32 h'fe04 pbc 8/16 2 break control register a * 4 bcra 8 h'fe08 pbc 8/16 2 break control register b * 4 bcrb 8 h'fe09 pbc 8/16 2 irq sense control register h iscrh 8 h'fe12 int 8 2 irq sense control register l iscrl 8 h'fe13 int 8 2 irq enable register ier 8 h'fe14 int 8 2 irq status register isr 8 h'fe15 int 8 2 dtc enable register * 4 dtcer 8 h'fe16 to h?fe1b, h'fe1e dtc 8 2 dtc vector register * 4 dtvecr 8 h'fe1f dtc 8 2 port 1 data direction register p1ddr 8 h'fe30 port 8 2 port 3 data direction register p3ddr 8 h'fe32 port 8 2
rev. 2.0, 09/02, page 551 of 658 register name abbrevia- tion bit no. address * 1 module data width access state port 7 data direction register p7ddr 8 h'fe36 port 8 2 port f data direction register pfddr 8 h'fe3e port 8 2 port 3 open drain control register p3odr 8 h'fe46 port 8 2 timer start register tstr 8 h'feb0 tpu 8 2 timer synchro register tsyr 8 h'feb1 tpu 8 2 interrupt priority register a * 4 ipra 8 h'fec0 int 8 2 interrupt priority register b * 4 iprb 8 h'fec1 int 8 2 interrupt priority register c * 4 iprc 8 h'fec2 int 8 2 interrupt priority register d * 4 iprd 8 h'fec3 int 8 2 interrupt priority register e * 4 ipre 8 h'fec4 int 8 2 interrupt priority register f * 4 iprf 8 h'fec5 int 8 2 interrupt priority register g * 4 iprg 8 h'fec6 int 8 2 interrupt priority register i * 4 ipri 8 h'fec8 int 8 2 interrupt priority register j * 4 iprj 8 h'fec9 int 8 2 interrupt priority register k * 4 iprk 8 h'feca int 8 2 interrupt priority register l * 4 iprl 8 h'fecb int 8 2 interrupt priority register m * 4 iprm 8 h'fecc int 8 2 interrupt priority register o * 4 ipro 8 h'fece int 8 2 ram emulation register ramer 8 h'fedb flash 8 2 port 1 data register p1dr 8 h'ff00 port 8 2 port 3 data register p3dr 8 h'ff02 port 8 2 port 7 data register p7dr 8 h'ff06 port 8 2 port f data register pfdr 8 h'ff0e port 8 2 timer control register_0 * 4 tcr_0 8 h'ff10 tpu_0 8 2 timer mode register_0 * 4 tmdr_0 8 h'ff11 tpu_0 8 2 timer i/o control register h_0 * 4 tiorh_0 8 h'ff12 tpu_0 8 2 timer i/o control register l_0 * 4 tiorl_0 8 h'ff13 tpu_0 8 2 timer interrupt enable register_0 * 4 tier_0 8 h'ff14 tpu_0 8 2 timer status register_0 * 4 tsr_0 8 h'ff15 tpu_0 8 2 timer counter_0 * 4 tcnt_0 16 h'ff16 tpu_0 16 2 timer general register a_0 * 4 tgra_0 16 h'ff18 tpu_0 16 2 timer general register b_0 * 4 tgrb_0 16 h'ff1a tpu_0 16 2 timer general register c_0 * 4 tgrc_0 16 h'ff1c tpu_0 16 2
rev. 2.0, 09/02, page 552 of 658 register name abbrevia- tion bit no. address * 1 module data width access state timer general register d_0 * 4 tgrd_0 16 h'ff1e tpu_0 16 2 timer control register_1 tcr_1 8 h'ff20 tpu_1 8 2 timer mode register_1 tmdr_1 8 h'ff21 tpu_1 8 2 timer i/o control register_1 tior_1 8 h'ff22 tpu_1 8 2 timer interrupt enable register_1 tier_1 8 h'ff24 tpu_1 8 2 timer status register_1 tsr_1 8 h'ff25 tpu_1 8 2 timer counter_1 tcnt_1 16 h'ff26 tpu_1 16 2 timer general register a_1 tgra_1 16 h'ff28 tpu_1 16 2 timer general register b_1 tgrb_1 16 h'ff2a tpu_1 16 2 timer control register_2 tcr_2 8 h'ff30 tpu_2 8 2 timer mode register_2 tmdr_2 8 h'ff31 tpu_2 8 2 timer i/o control register_2 tior_2 8 h'ff32 tpu_2 8 2 timer interrupt enable register_2 tier_2 8 h'ff34 tpu_2 8 2 timer status register_2 tsr_2 8 h'ff35 tpu_2 8 2 timer counter_2 tcnt_2 16 h'ff36 tpu_2 16 2 timer general register a_2 tgra_2 16 h'ff38 tpu_2 16 2 timer general register b_2 tgrb_2 16 h'ff3a tpu_2 16 2 timer control register_0 tcr_0 8 h'ff68 tmr_0 8 2 timer control register_1 tcr_1 8 h'ff69 tmr_1 8 2 timer control/status register_0 tcsr_0 8 h'ff6a tmr_0 8 2 timer control/status register_1 tcsr_1 8 h'ff6b tmr_1 8 2 time constant register a_0 tcora_0 8 h'ff6c tmr_0 8/16 2 time constant register a_1 tcora_1 8 h'ff6d tmr_1 8/16 2 time constant register b_0 tcorb_0 8 h'ff6e tmr_0 8/16 2 time constant register b_1 tcorb_1 8 h'ff6f tmr_1 8/16 2 timer counter_0 tcnt_0 8 h'ff70 tmr_0 8/16 2 timer counter_1 tcnt_1 8 h'ff71 tmr_1 8/16 2 timer control/status register_0 tcsr_0 8 h'ff74(w) h'ff74(r) wdt_0 16 2 timer counter_0 tcnt_0 8 h'ff74(w) h'ff75(r) wdt_0 16 2
rev. 2.0, 09/02, page 553 of 658 register name abbrevia- tion bit no. address * 1 module data width access state reset control/status register rstcsr 8 h'ff76(w) h'ff77(r) wdt_0 16 2 serial mode register_0 smr_0 8 h'ff78 * 3 sci_0 8 2 i 2 c bus control register_0 iccr_0 8 h'ff78 * 3 iic_0 8 2 bit rate register_0 brr_0 8 h'ff79 * 3 sci_0 8 2 i 2 c bus status register_0 icsr_0 8 h'ff79 * 3 iic_0 8 2 serial control register_0 scr_0 8 h'ff7a sci_0 8 2 transmit data register_0 tdr_0 8 h'ff7b sci_0 8 2 serial status register_0 ssr_0 8 h'ff7c sci_0 8 2 receive data register_0 rdr_0 8 h'ff7d sci_0 8 2 smart card mode register_0 scmr_0 8 h'ff7e * 3 sci_0 8 2 i 2 c bus data register_0/second slave address register_0 icdr_0 /sarx_0 8 h'ff7e * 3 iic_0 8 2 i 2 c bus mode register_0/slave address register_0 icmr_0 /sar_0 8 h'ff7f iic_0 8 2 serial mode register_1 smr_1 8 h'ff80 * 3 sci_1 8 2 i 2 c bus control register_1 * 4 iccr_1 8 h'ff80 * 3 iic_1 8 2 bit rate register_1 brr_1 8 h'ff81 * 3 sci_1 8 2 i 2 c bus status register_1 * 4 icsr_1 8 h'ff81 * 3 iic_1 8 2 serial control register_1 scr_1 8 h'ff82 sci_1 8 2 transmit data register_1 tdr_1 8 h'ff83 sci_1 8 2 serial status register_1 ssr_1 8 h'ff84 sci_1 8 2 receive data register_1 rdr_1 8 h'ff85 sci_1 8 2 smart card mode register_1 scmr_1 8 h'ff86 * 3 sci_1 8 2 i 2 c bus data register_1/second slave address register_1 * 4 icdr_1 /sarx_1 8 h'ff86 * 3 iic_1 8 2 i 2 c bus mode register_1/slave address register_1 * 4 icmr_1 /sar_1 8 h'ff87 iic_1 8 2 a/d data register ah addrah 8 h'ff90 a/d 8 2 a/d data register al addral 8 h'ff91 a/d 8 2 a/d data register bh addrbh 8 h'ff92 a/d 8 2 a/d data register bl addrbl 8 h'ff93 a/d 8 2 a/d data register ch addrch 8 h'ff94 a/d 8 2 a/d data register cl addrcl 8 h'ff95 a/d 8 2
rev. 2.0, 09/02, page 554 of 658 register name abbrevia- tion bit no. address * 1 module data width access state a/d data register dh addrdh 8 h'ff96 a/d 8 2 a/d data register dl addrdl 8 h'ff97 a/d 8 2 a/d control/status register adcsr 8 h'ff98 a/d 8 2 a/d control register adcr 8 h'ff99 a/d 8 2 timer control/status register_1 tcsr_1 8 h'ffa2(w) h'ffa2(r) wdt_1 16 2 timer counter_1 tcnt_1 8 h'ffa2(w) h'ffa3(r) wdt_1 16 2 flash memory control register 1 flmcr1 8 h'ffa8 flash 8 2 flash memory control register 2 flmcr2 8 h'ffa9 flash 8 2 erase block register 1 ebr1 8 h'ffaa flash 8 2 erase block register 2 ebr2 8 h'ffab flash 8 2 flash memory power control register flpwcr 8 h'ffac flash 8 2 port 1 register port1 8 h'ffb0 port 8 2 port 3 register port3 8 h?ffb2 port 8 2 port 4 register port4 8 h'ffb3 port 8 2 port 7 register port7 8 h'ffb6 port 8 2 port 9 register port9 8 h'ffb8 port 8 2 port f register portf 8 h'ffbe port 8 2 notes: 1. lower 16 bits of the address. 2. allocated on the on-chip ram. 32-bit bus when dtc accesses as register information, and 16-bit in other cases. 3. part of registers sci_0 and sci_1 and part of registers iic_0 and iic_1 * 4 are allocated to the same address. use the iice bit of the serial control register x (scrx) to select the register. 4. supported only by the h8s/2268 series. 5. supported only by the h8s/2264 series.
rev. 2.0, 09/02, page 555 of 658 25.2 register bits register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module mra * 1 sm1 sm0 dm1 dm0 md1 md0 dts sz dtc sar * 1 mrb * 1 chne disel ?????? dar * 1 cra * 1 crb * 1 lpcr dts1 dts0 cmx ? sgs3 sgs2 sgs1 sgs0 lcd lcr ? psw act disp cks3 cks2 cks1 cks0 lcr2 lcdab ? hcks * 4 sups * 4 cds3 cds2 cds1 cds0 lcd ram bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 mstpcrd mstpd7 mstpd6 mstpd5 mstpd4 mstpd3 mstpd2 mstpd1 mstpd0 system sckcr2 * 2 phoe rxd1s subcks1 subcks0 phck3 phck2 phck1 phck0 dtcr * 1 dten ? cloe rwoe clf1 clf0 rwf1 rwf0 dtmf dtlr * 1 ?? dtl5 dtl4 dtl3 dtl2 dtl1 dtl0 tcr_4 * 1 arsl ovf ovie ?? cks2 cks1 cks0 tmr_4 tcr_5 * 1 arsl ovf ovie ?? cks2 cks1 cks0 tcr_6 * 1 arsl ovf ovie ?? cks2 cks1 cks0 tcr_7 * 1 arsl ovf ovie ?? cks2 cks1 cks0 tcnt_4(r) /tlr_4(w) * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcnt_5(r) /tlr_5(w) * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcnt_6(r) /tlr_6(w) * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcnt_7(r) /tlr_7(w) * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
rev. 2.0, 09/02, page 556 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module phddr ?? ph5ddr * 3 ph4ddr * 3 ph3ddr ph2ddr ph1ddr ph0ddr port pjddr pj7ddr pj6ddr pj5ddr pj4ddr pj3ddr pj2ddr pj1ddr pj0ddr pkddr pk7ddr pk6ddr pk5ddr pk4ddr pk3ddr pk2ddr pk1ddr pk0ddr plddr pl7ddr pl6ddr pl5ddr pl4ddr pl3ddr pl2ddr pl1ddr pl0ddr pmddr * 1 pm7ddr pm6ddr pm5ddr pm4ddr pm3ddr pm2ddr pm1ddr pm0ddr pnddr * 1 pn7ddr pn6ddr pn5ddr pn4ddr pn3ddr pn2ddr pn1ddr pn0ddr phdr ?? phd5r * 3 ph4dr * 3 ph3dr ph2dr ph1dr ph0dr pjdr pj7dr pj6dr pj5dr pj4dr pj3dr pj2dr pj1dr pj0dr pkdr pk7dr pk6dr pk5dr pk4dr pk3dr pk2dr pk1dr pk0dr pldr pl7dr pl6dr pl5dr pl4dr pl3dr pl2dr pl1dr pl0dr pmdr * 1 pm7dr pm6dr pm5dr pm4dr pm3dr pm2dr pm1dr pm0dr pndr * 1 pn7dr pn6dr pn5dr pn4dr pn3dr pn2dr pn1dr pn0dr porth ph7 ? ph5 * 3 ph4 * 3 ph3 ph2 ph1 ph0 portj pj7 pj6 pj5 pj4 pj3 pj2 pj1 pj0 portk pk7 pk6 pk5 pk4 pk3 pk2 pk1 pk0 portl pl7 pl6 pl5 pl4 pl3 pl2 pl1 pl0 portm * 1 pm7 pm6 pm5 pm4 pm3 pm2 pm1 pm0 portn * 1 pn7 pn6 pn5 pn4 pn3 pn2 pn1 pn0 pjpcr pj7pcr pj6pcr pj5pcr pj4pcr pj3pcr pj2pcr pj1pcr pj0pcr wpcr wpc7 wpc6 wpc5 wpc4 wpc3 wpc2 wpc1 wpc0 iwpr iwpf7 iwpf6 iwpf5 iwpf4 iwpf3 iwpf2 iwpf1 iwpf0 int ienr1 ienwp ??????? dadr_0 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 d/a dadr_1 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 dacr * 1 daoe1 daoe0 dae ????? scrx ? iicx1 * 4 iicx0 iice flshe ??? iic, flash ddcswr ???? clr3 clr2 clr1 clr0 iic tcr_2 * 1 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_2 tcr_3 * 1 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_3 tcsr_2 * 1 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_2 tcsr_3 * 1 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_3 tcora_2 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_2 tcora_3 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_3
rev. 2.0, 09/02, page 557 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tcorb_2 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_2 tcorb_3 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_3 tcnt_2 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_2 tcnt_3 * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_3 smr_2 c / a chr pe o / e stop mp cks1 cks0 sci_2 smr_2 gm blk pe o / e bcp1 bcp0 cks1 cks0 brr_2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 scr_2 tie rie te re mpie teie cke1 cke0 tdr_2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ssr_2 tdre rdrf orer fer per tend mpb mpbt ssr_2 tdre rdrf orer ers per tend mpb mpbt rdr_2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 scmr_2 ???? sdir sinv ? smif sbycr ssby sts2 sts1 sts0 ???? system syscr ?? intm1 intm0 nmieg ??? sckcr ????? sck2 sck1 sck0 mdcr ????? mds2 mds1 ? mstpcra mstpa7 mstpa6 mstpa5 mstpa4 mstpa3 mstpa2 mstpa1 mstpa0 mstpcrb mstpb7 mstpb6 mstpb5 mstpb4 mstpb3 mstpb2 mstpb1 mstpb0 mstpcrc mstpc7 mstpc6 mstpc5 mstpc4 mstpc3 mstpc2 mstpc1 mstpc0 lpwrcr dton lson nesel substp rfcut ? stc1 stc0 semr0 ???? abcs acs2 acs1 acs0 sci_0 bara * 1 ???????? pbc baa23 baa22 baa21 baa20 baa19 baa18 baa17 baa16 baa15 baa14 baa13 baa12 baa11 baa10 baa9 baa8 baa7 baa6 baa5 baa4 baa3 baa2 baa1 baa0 barb * 1 ???????? bab23 bab22 bab21 bab20 bab19 bab18 bab17 bab16 bab15 bab14 bab13 bab12 bab11 bab10 bab9 bab8 bab7 bab6 bab5 bab4 bab3 bab2 bab1 bab0 bcra * 1 cmfa cda bamra2 bamra1 bamra0 csela1 csela0 biea bcrb * 1 cmfb cdb bamrb2 bamrb1 bamrb0 cselb1 cselb0 bieb
rev. 2.0, 09/02, page 558 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module iscrh ???? irq5scb * 4 irq5sca * 4 irq4scb irq4sca int iscrl irq3scb irq3sca ?? irq1scb irq1sca irq0scb irq0sca ier ?? irq5e * 4 irq4e irq3e ? irq1e irq0e isr ?? irq5f * 4 irq4f irq3f ? irq1f irq0f dtcer * 1 dtce7 dtce6 dtce5 dtce4 dtce3 dtce2 dtce1 dtce0 dtc dtvecr * 1 swdte dtvec6 dtvec5 dtvec4 dtvec3 dtvec2 dtvec1 dtvec0 p1ddr p17ddr p16ddr p15ddr p14ddr p13ddr p12ddr p11ddr p10ddr port p3ddr ?? p35ddr p34ddr p33ddr p32ddr p31ddr p30ddr p7ddr p77ddr p76ddr p75ddr p74ddr p73ddr p72ddr p71ddr p70ddr pfddr ???? pf3ddr ??? p3odr ?? p35odr p34odr p33odr p32odr p31odr p30odr tstr ????? cst2 cst1 cst0 * 4 tpu tsyr ????? sync2 sync1 sync0 * 4 ipra * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 int iprb * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprc * 1 ????? ipr2 ipr1 ipr0 iprd * 1 ? ipr6 ipr5 ipr4 ???? ipre * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprf * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprg * 1 ? ipr6 ipr5 ipr4 ???? ipri * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprj * 1 ????? ipr2 ipr1 ipr0 iprk * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprl * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprm * 1 ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 ipro * 1 ? ipr6 ipr5 ipr4 ???? ramer ???? rams ram2 * 4 ram1 ram0 flash p1dr p17dr p16dr p15dr p14dr p13dr p12dr p11dr p10dr port p3dr ?? p35dr p34dr p33dr p32dr p31dr p30dr p7dr p77dr p76dr p75dr p74dr p73dr p72dr p71dr p70dr pfdr ???? pf3dr ???
rev. 2.0, 09/02, page 559 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tcr_0 * 1 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_0 tmdr_0 * 1 ?? bfb bfa md3 md2 md1 md0 tiorh_0 * 1 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_0 * 1 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0 tier_0 * 1 ttge ?? tciev tgied tgiec tgieb tgiea tsr_0 * 1 ??? tcfv tgfd tgfc tgfb tgfa tcnt_0 * 1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgra_0 * 1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgrb_0 * 1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgrc_0 * 1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgrd_0 * 1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcr_1 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_1 tmdr_1 ???? md3 md2 md1 md0 tior_1 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_1 ttge ? tcieu * 4 tciev ?? tgieb tgiea tsr_1 tcfd * 4 ? tcfu * 4 tcfv ?? tgfb tgfa tcnt_1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgra_1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgrb_1 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcr_2 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_2 tmdr_2 ???? md3 md2 md1 md0 tior_2 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_2 ttge ? tcieu * 4 tciev ?? tgieb tgiea tsr_2 tcfd * 4 ? tcfu * 4 tcfv ?? tgfb tgfa
rev. 2.0, 09/02, page 560 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tcnt_2 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 tpu_2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgra_2 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tgrb_2 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tcr_0 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_0 tcr_1 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_1 tcsr_0 cmfb cmfa ovf adte os3 os2 os1 os0 tmr_0 tcsr_1 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_1 tcora_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_0 tcora_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_1 tcorb_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_0 tcorb_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_1 tcnt_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_0 tcnt_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 tmr_1 tcsr_0 ovf wt / it tme ?? cks2 cks1 cks0 wdt_0 tcnt_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rstcsr wovf rste ?????? smr_0 c / a chr pe o / e stop mp cks1 cks0 sci_0 smr_0 gm blk pe o / e bcp1 bcp0 cks1 cks0 iccr_0 ice ieic mst trs acke bbsy iric scp iic_0 brr_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 sci_0 icsr_0 estp stop irtr aasx al aas adz ackb iic_0 scr_0 tie rie te re mpie teie cke1 cke0 sci_0 tdr_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ssr_0 tdre rdrf orer fer per tend mpb mpbt ssr_0 tdre rdrf orer ers per tend mpb mpbt rdr_0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 scmr_0 ???? sdir sinv ? smif icdr_0 / sarx_0 icdr7 / svax6 icdr6 / svax5 icdr5 / svax4 icdr4 / svax3 icdr3 / svax2 icdr2 / svax1 icdr1 / svax0 icdr0 / fsx iic_0 icmr_0 / sar_0 mls / sva6 wait / sva5 cks2 / sva4 cks1 / sva3 cks0 / sva2 bc2 / sva1 bc1 / sva0 bc0 / fs
rev. 2.0, 09/02, page 561 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module smr_1 c / a chr pe o / e stop mp cks1 cks0 sci_1 smr_1 gm blk pe o / e bcp1 bcp0 cks1 cks0 iccr_1 * 1 ice ieic mst trs acke bbsy iric scp iic_1 brr_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 sci_1 icsr_1 * 1 estp stop irtr aasx al aas adz ackb iic_1 scr_1 tie rie te re mpie teie cke1 cke0 sci_1 tdr_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ssr_1 tdre rdrf orer fer per tend mpb mpbt ssr_1 tdre rdrf orer ers per tend mpb mpbt rdr_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 scmr_1 ???? sdir sinv ? smif icdr_1 / sarx_1 * 1 icdr7 / svax6 icdr6 / svax5 icdr5 / svax4 icdr4 / svax3 icdr3 / svax2 icdr2 / svax1 icdr1 / svax0 icdr0 / fsx iic_1 icmr_1 / sar_1 * 1 mls / sva6 wait / sva5 cks2 / sva4 cks1 / sva3 cks0 / sva2 bc2 / sva1 bc1 / sva0 bc0 / fs addrah ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 a/d addral ad1 ad0 ?????? addrbh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrbl ad1 ad0 ?????? addrch ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrcl ad1 ad0 ?????? addrdh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrdl ad1 ad0 ?????? adcsr adf adie adst scan ch3 ch2 ch1 ch0 adcr trgs1 trgs0 ?? cks1 cks0 ?? tcsr_1 ovf wt / it tme pss rst / nmi cks2 cks1 cks0 wdt_1 tcnt_1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 flmcr1 fwe swe1 esu1 psu1 ev1 pv1 e1 p1 flash flmcr2 fler ??????? ebr1 eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 ebr2 ???? eb11 * 4 eb10 * 4 eb9 eb8 flpwcr pdwnd ???????
rev. 2.0, 09/02, page 562 of 658 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module port1 p17 p16 p15 p14 p13 p12 p11 p10 port port3 ?? p35 p34 p33 p32 p31 p30 port4 p47 p46 p45 p44 p43 p42 p41 p40 port7 p77 p76 p75 p74 p73 p72 p71 p70 port9 p97 p96 ?????? portf ???? pf3 ??? notes: 1. supported only by the h8s/2268 series. 2. supported only by the h8s/2264 series. 3. reserved in the h8s/2268 series. 4. reserved in the h8s/2264 series.
rev. 2.0, 09/02, page 563 of 658 25.3 register states in each operating mode register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module mra * 1 ??? ???? ??? dtc sar * 1 ??? ???? ??? mrb * 1 ??? ???? ??? dar * 1 ??? ???? ??? cra * 1 ??? ???? ??? crb * 1 ??? ???? ??? lpcr initialized ? ? ?? ?? ? ? initialized lcd lcr initialized ? ? ?? ?? ? ? initialized lcr2 initialized ? ? ?? ?? ? ? initialized lcd ram ??? ???? ??? mstpcrd initialized ? ? ?? ?? ? ? initialized system sckcr2 * 2 initialized ? ? ?? ?? ? ? initialized dtcr * 1 initialized ? ? ?? ?? ? ? initialized dtmf dtlr * 1 initialized ? ? ?? ?? ? ? initialized tcr_4 * 1 initialized ? ? ?? ?? ? ? initialized tmr_4 tcr_5 * 1 initialized ? ? ?? ?? ? ? initialized tcr_6 * 1 initialized ? ? ?? ?? ? ? initialized tcr_7 * 1 initialized ? ? ?? ?? ? ? initialized tcnt_4/ tlr_4 * 1 initialized ? ? ?? ?? ? ? initialized tcnt_5/ tlr_5 * 1 initialized ? ? ?? ?? ? ? initialized tcnt_6/ tlr_6 * 1 initialized ? ? ?? ?? ? ? initialized tcnt_7/ tlr_7 * 1 initialized ? ? ?? ?? ? ? initialized phddr initialized ? ? ?? ?? ? ? initialized port pjddr initialized ? ? ?? ?? ? ? initialized pkddr initialized ? ? ?? ?? ? ? initialized plddr initialized ? ? ?? ?? ? ? initialized pmddr * 1 initialized ? ? ?? ?? ? ? initialized pnddr * 1 initialized ? ? ?? ?? ? ? initialized phdr initialized ? ? ?? ?? ? ? initialized
rev. 2.0, 09/02, page 564 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module pjdr initialized ? ? ?? ?? ? ? initialized port pkdr initialized ? ? ?? ?? ? ? initialized pldr initialized ? ? ?? ?? ? ? initialized pmdr * 1 initialized ? ? ?? ?? ? ? initialized pndr * 1 initialized ? ? ?? ?? ? ? initialized porth initialized ? ? ?? ?? ? ? initialized portj initialized ? ? ?? ?? ? ? initialized portk initialized ? ? ?? ?? ? ? initialized portl initialized ? ? ?? ?? ? ? initialized portm * 1 initialized ? ? ?? ?? ? ? initialized portn * 1 initialized ? ? ?? ?? ? ? initialized pjpcr initialized ? ? ?? ?? ? ? initialized wpcr initialized ? ? ?? ?? ? ? initialized iwpr initialized ? ? ?? ?? ? ? initialized int ienr1 initialized ? ? ?? ?? ? ? initialized dadr_0 * 1 initialized ? ? ?? ?? ? ? initialized d/a dadr_1 * 1 initialized ? ? ?? ?? ? ? initialized dacr initialized ? ? ?? ?? ? ? initialized scrx initialized ? ? ?? ?? ? ? initialized iic, flash ddcswr initialized ? ? ?? ?? ? ? initialized iic tcr_2 * 1 initialized ? ? ?? ?? ? ? initialized tmr_2 tcr_3 * 1 initialized ? ? ?? ?? ? ? initialized tmr_3 tcsr_2 * 1 initialized ? ? ?? ?? ? ? initialized tmr_2 tcsr_3 * 1 initialized ? ? ?? ?? ? ? initialized tmr_3 tcora_2 * 1 initialized ? ? ?? ?? ? ? initialized tmr_2 tcora_3 * 1 initialized ? ? ?? ?? ? ? initialized tmr_3 tcorb_2 * 1 initialized ? ? ?? ?? ? ? initialized tmr_2 tcorb_3 * 1 initialized ? ? ?? ?? ? ? initialized tmr_3 tcnt_2 * 1 initialized ? ? ?? ?? ? ? initialized tmr_2 tcnt_3 * 1 initialized ? ? ?? ?? ? ? initialized tmr_3 smr_2 initialized ? ? ?? ?? ? ? initialized sci_2 brr_2 initialized ? ? ?? ?? ? ? initialized scr_2 initialized ? ? ?? ?? ? ? initialized
rev. 2.0, 09/02, page 565 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module tdr_2 initialized ?? ? initialized initialized initialized initialized initialized initialized sci_2 ssr_2 initialized ?? ? initialized initialized initialized initialized initialized initialized rdr_2 initialized ?? ? initialized initialized initialized initialized initialized initialized scmr_2 initialized ? ? ?? ?? ? ? initialized sbycr initialized ? ? ?? ?? ? ? initialized system syscr initialized ? ? ?? ?? ? ? initialized sckcr initialized ? ? ?? ?? ? ? initialized mdcr initialized ? ? ?? ?? ? ? initialized mstpcra initialized ? ? ?? ?? ? ? initialized mstpcrb initialized ? ? ?? ?? ? ? initialized mstpcrc initialized ? ? ?? ?? ? ? initialized lpwrcr initialized ? ? ?? ?? ? ? initialized semr_0 initialized ? ? ?? ?? ? ? initialized sci_0 bara * 1 initialized ? ? ?? ?? ? ? initialized pbc barb * 1 initialized ? ? ?? ?? ? ? initialized bcra * 1 initialized ? ? ?? ?? ? ? initialized bcrb * 1 initialized ? ? ?? ?? ? ? initialized iscrh initialized ? ? ?? ?? ? ? initialized int iscrl initialized ? ? ?? ?? ? ? initialized ier initialized ? ? ?? ?? ? ? initialized isr initialized ? ? ?? ?? ? ? initialized dtcer * 1 initialized ? ? ?? ?? ? ? initialized dtc dtvecr * 1 initialized ? ? ?? ?? ? ? initialized p1ddr initialized ? ? ?? ?? ? ? initialized port p3ddr initialized ? ? ?? ?? ? ? initialized p7ddr initialized ? ? ?? ?? ? ? initialized pfddr initialized ? ? ?? ?? ? ? initialized p3odr initialized ? ? ?? ?? ? ? initialized tstr initialized ? ? ?? ?? ? ? initialized tpu tsyr initialized ? ? ?? ?? ? ? initialized ipra * 1 initialized ? ? ?? ?? ? ? initialized int iprb * 1 initialized ? ? ?? ?? ? ? initialized iprc * 1 initialized ? ? ?? ?? ? ? initialized iprd * 1 initialized ? ? ?? ?? ? ? initialized
rev. 2.0, 09/02, page 566 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module ipre * 1 initialized ? ? ?? ?? ? ? initialized int iprf * 1 initialized ? ? ?? ?? ? ? initialized iprg * 1 initialized ? ? ?? ?? ? ? initialized ipri * 1 initialized ? ? ?? ?? ? ? initialized iprj * 1 initialized ? ? ?? ?? ? ? initialized iprk * 1 initialized ? ? ?? ?? ? ? initialized iprl * 1 initialized ? ? ?? ?? ? ? initialized iprm * 1 initialized ? ? ?? ?? ? ? initialized ipro * 1 initialized ? ? ?? ?? ? ? initialized ramer initialized ? ? ?? ?? ? ? initialized flash p1dr initialized ? ? ?? ?? ? ? initialized port p3dr initialized ? ? ?? ?? ? ? initialized p7dr initialized ? ? ?? ?? ? ? initialized pfdr initialized ? ? ?? ?? ? ? initialized tcr_0 * 1 initialized ? ? ?? ?? ? ? initialized tpu_0 tmdr_0 * 1 initialized ? ? ?? ?? ? ? initialized tiorh_0 * 1 initialized ? ? ?? ?? ? ? initialized tiorl_0 * 1 initialized ? ? ?? ?? ? ? initialized tier_0 * 1 initialized ? ? ?? ?? ? ? initialized tsr_0 * 1 initialized ? ? ?? ?? ? ? initialized tcnt_0 * 1 initialized ? ? ?? ?? ? ? initialized tgra_0 * 1 initialized ? ? ?? ?? ? ? initialized tgrb_0 * 1 initialized ? ? ?? ?? ? ? initialized tgrc_0 * 1 initialized ? ? ?? ?? ? ? initialized tgrd_0 * 1 initialized ? ? ?? ?? ? ? initialized tcr_1 initialized ? ? ?? ?? ? ? initialized tpu_1 tmdr_1 initialized ? ? ?? ?? ? ? initialized tior_1 initialized ? ? ?? ?? ? ? initialized tier_1 initialized ? ? ?? ?? ? ? initialized tsr_1 initialized ? ? ?? ?? ? ? initialized tcnt_1 initialized ? ? ?? ?? ? ? initialized tgra_1 initialized ? ? ?? ?? ? ? initialized tgrb_1 initialized ? ? ?? ?? ? ? initialized tcr_2 initialized ? ? ?? ?? ? ? initialized tpu_2
rev. 2.0, 09/02, page 567 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module tmdr_2 initialized ? ? ?? ?? ? ? initialized tpu_2 tior_2 initialized ? ? ?? ?? ? ? initialized tier_2 initialized ? ? ?? ?? ? ? initialized tsr_2 initialized ? ? ?? ?? ? ? initialized tcnt_2 initialized ? ? ?? ?? ? ? initialized tgra_2 initialized ? ? ?? ?? ? ? initialized tgrb_2 initialized ? ? ?? ?? ? ? initialized tcr_0 initialized ? ? ?? ?? ? ? initialized tmr_0 tcr_1 initialized ? ? ?? ?? ? ? initialized tmr_1 tcsr_0 initialized ? ? ?? ?? ? ? initialized tmr_0 tcsr_1 initialized ? ? ?? ?? ? ? initialized tmr_1 tcora_0 initialized ? ? ?? ?? ? ? initialized tmr_0 tcora_1 initialized ? ? ?? ?? ? ? initialized tmr_1 tcorb_0 initialized ? ? ?? ?? ? ? initialized tmr_0 tcorb_1 initialized ? ? ?? ?? ? ? initialized tmr_1 tcnt_0 initialized ? ? ?? ?? ? ? initialized tmr_0 tcnt_1 initialized ? ? ?? ?? ? ? initialized tmr_1 tcsr_0 initialized ? ? ?? ?? ? ? initialized wdt_0 tcnt_0 initialized ? ? ?? ?? ? ? initialized rstcsr initialized ? ? ?? ?? ? ? initialized smr_0 initialized ? ? ?? ?? ? ? initialized sci_0 iccr_0 initialized ? ? ?? ?? ? ? initialized iic_0 brr_0 initialized ? ? ?? ?? ? ? initialized sci_0 icsr_0 initialized ? ? ?? ?? ? ? initialized iic_0 scr_0 initialized ? ? ?? ?? ? ? initialized sci_0 tdr_0 initialized ?? ? initialized initialized initialized initialized initialized initialized ssr_0 initialized ?? ? initialized initialized initialized initialized initialized initialized rdr_0 initialized ?? ? initialized initialized initialized initialized initialized initialized scmr_0 initialized ? ? ?? ?? ? ? initialized icdr_0/ sarx_0 initialized ? ? ?? ?? ? ? initialized iic_0 icmr_0/ sar_0 initialized ? ? ?? ?? ? ? initialized
rev. 2.0, 09/02, page 568 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module smr_1 initialized ?? ?????? initialized sci_1 iccr_1 * 1 initialized ?? ?????? initialized iic_1 brr_1 initialized ?? ?????? initialized sci_1 icsr_1 * 1 initialized ?? ?????? initialized iic_1 scr_1 initialized ?? ?????? initialized sci_1 tdr_1 initialized ?? ? initialized initialized initialized initialized initialized initialized ssr_1 initialized ?? ? initialized initialized initialized initialized initialized initialized rdr_1 initialized ?? ? initialized initialized initialized initialized initialized initialized scmr_1 initialized ?? ?????? initialized icdr_1/ sarx_1 * 1 initialized ?? ?????? initialized iic_1 icmr_1/ sar_1 * 1 initialized ?? ?????? initialized addrah initialized ?? ? initialized initialized initialized initialized initialized initialized a/d addral initialized ?? ? initialized initialized initialized initialized initialized initialized addrbh initialized ?? ? initialized initialized initialized initialized initialized initialized addrbl initialized ?? ? initialized initialized initialized initialized initialized initialized addrch initialized ?? ? initialized initialized initialized initialized initialized initialized addrcl initialized ?? ? initialized initialized initialized initialized initialized initialized addrdh initialized ?? ? initialized initialized initialized initialized initialized initialized addrdl initialized ?? ? initialized initialized initialized initialized initialized initialized adcsr initialized ?? ? initialized initialized initialized initialized initialized initialized adcr initialized ?? ? initialized initialized initialized initialized initialized initialized tcsr_1 initialized ?? ?????? initialized wdt_1 tcnt_1 initialized ?? ?????? initialized flmcr1 initialized ?? ????? initialized initialized flash flmcr2 initialized ?? ????? initialized initialized ebr1 initialized ?? ????? initialized initialized ebr2 initialized ?? ????? initialized initialized flpwcr initialized ?? ????? initialized initialized port1 initialized ?? ?????? initialized port port3 initialized ?? ?????? initialized port4 initialized ?? ?????? initialized
rev. 2.0, 09/02, page 569 of 658 register name reset high -speed medium- speed sleep module stop watch subactive subsleep software standby hardware standby module port7 initialized ?? ?????? initialized port port9 initialized ?? ?????? initialized portf initialized ?? ?????? initialized notes: ? is not initialized. 1. supported only by the h8s/2268 series. 2. supported only by the h8s/2264 series.
rev. 2.0, 09/02, page 570 of 658
rev. 2.0, 09/02, page 571 of 658 section 26 electrical characteristics 26.1 power supply voltage and operating frequency range power supply voltage and operating frequency ranges (shaded areas) are shown in figure 26.1. system clock (1) power supply voltage and range of oscillation frequency (condition a) condition a (f-ztat version) : vcc = 3.0 to 5.5v, avcc = 2.7 to 5.5v, vref = 2.7v to avcc, vss = avss = 0v, = 32.768khz, 2 to 13.5mhz, ta = -20 to +75 (regular specification), ta = -40 to + 85 (wide range specification) condition b (mask rom version) : vcc = 2.7 to 5.5v, avcc = 2.7 to 5.5v, vref = 2.7v to avcc, vss = avss = 0v, = 32.768khz, 2 to 13.5mhz, ta = -20 to +75 (regular specification), ta = -40 to + 85 (wide range specification) condition c (f-ztat version) : vcc = 4.0 to 5.5v, avcc = 4.0 to 5.5v, vref = 4.0v to avcc, vss = avss = 0v, = 32.768khz, 10 to 20.5mhz, ta = -20 to +75 (regular specification), ta = -40 to + 85 (wide range specification) condition d (mask rom version) : vcc = 4.0 to 5.5v, avcc = 4.0 to 5.5v, vref = 4.0v to avcc, vss = avss = 0v, = 32.768khz, 10 to 20.5mhz, ta = -20 to +75 (regular specification), ta = -40 to + 85 (wide range specification) active (high-speed/medium-speed) mode sleep mode f (mhz) 20.5 13.5 2.0 0 2.7 3.0 4.0 5.5 vcc (v) sub clock sub clock aii operating modes system clock (2) power supply voltage and range of oscillation frequency (condition b) active (high-speed/medium-speed) mode sleep mode aii operating modes f (khz) 32.768 0 2.7 3.0 4.0 5.5 vcc (v) f (mhz) 20.5 13.5 2.0 0 2.7 3.0 4.0 5.5 vcc (v) f (khz) 32.768 0 2.7 3.0 4.0 5.5 vcc (v) figure 26.1 power supply voltage and operating ranges (1)
rev. 2.0, 09/02, page 572 of 658 48.8 74 500 0 2.7 3.0 4.0 5.5 30.5 0 2.7 3.0 4.0 5.5 48.8 74 500 0 2.7 3.0 4.0 5.5 30.5 0 2.7 3.0 4.0 5.5 48.8 74 100 500 0 2.7 3.0 4.0 5.5 30.5 0 2.7 3.0 4.0 5.5 20.5 13.5 10.0 2.0 0 2.7 3.0 4.0 5.5 32.768 0 2.7 3.0 4.0 5.5 system clock (3) power supply voltage and range of oscillation frequency (condition c and d) active (high-speed/medium-speed) mode sleep mode f (mhz) t (ns) vcc (v) sub clock aii operating modes f (khz) system clock (4) power supply voltage and range of instruction execution (condition a) active (high-speed/medium-speed) mode sub clock subactive mode t ( s) t (ns) system clock (5) power supply voltage and range of instruction execution (condition b) active (high-speed/medium-speed) mode sub clock subactive mode t ( s) vcc (v) vcc (v) vcc (v) vcc (v) vcc (v) t (ns) system clock (6) power supply voltage and range of instruction execution (condition c and d) active (high-speed/medium-speed) mode sub clock subactive mode t ( s) vcc (v) vcc (v) figure 26.1 power supply voltage and operating ranges (2)
rev. 2.0, 09/02, page 573 of 658 26.2 electrical characteristics of the h8s/2268 series 26.2.1 absolute maximum ratings table 26.1 lists the absolute maximum ratings. table 26.1 absolute maximum ratings item symbol value unit power supply voltage v cc ?0.3 to +7.0 v cv cc ?0.3 to +4.3 v input voltage (except port 4, 9, ph7) v in ?0.3 to v cc +0.3 v input voltage (port 4, 9, ph7) v in ?0.3 to av cc +0.3 v reference voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +7.0 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 * c wide-range specifications: ?40 to +85 * c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. note: * operating temperature range for flash memory programming/erasing is t a = -20 to +75c.
rev. 2.0, 09/02, page 574 of 658 26.2.2 dc characteristics table 26.2 lists the dc characteristics. table 26.3 lists the permissible output currents. table 26.4 lists the bus drive characteristics. table 26.2 dc characteristics (1) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions vt - v cc x 0.2 ? ? v vt + ??v cc x 0.8 v vt + - vt - v cc x 0.05 ? ? v vcc = 4.0 to 5.5 v schmitt trigger input voltage irq0 , irq1 , irq3 to irq5 , wkp0 to wkp7 v cc x 0.04 ? ? v vcc = 2.7 to 4.0 v input high voltage res , stby , nmi, fwe, md2, md1 v ih v cc x 0.9 ? v cc + 0.3 v extal, port 1, 3, 7, f, j to n, ph0 to ph3 v cc x 0.8 ? v cc + 0.3 v port 4, 9, ph7 v cc x 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2, md1 v il - 0.3 ? v cc x 0.1 v nmi, extal, port 1, 3, 4, 7, 9, f, h, j to n - 0.3 ? v cc x 0.2 v
rev. 2.0, 09/02, page 575 of 658 item symbol min. typ. max. unit test conditions v oh v cc - 0.5 ? ? v i oh = - 200 a all output pins except p34 and p35, ph0 to ph3, and port j to n v cc - 1.0 ? ? v i oh = - 1 ma p34 and p35 * 2 v cc - 2.7 ? ? v i oh = - 100 a v cc = 4.0 to 5.5 v v cc - 0.5 ? ? v i oh = - 200 a output high voltage ph0 to ph3, port j to n v cc - 1.0 ? ? v i oh = - 1 ma v cc = 4.0 to 5.5 v all output pins * 3 v ol ??0.4vi ol = - 0.8 ma i ol = 5 ma output low voltage port 7 ? ? 1.0 v i ol = 10 ma, v cc = 4.0 to 5.5 v res ??1.0 a stby , nmi, fwe, md2, md1 ??1.0 a v in = 0.5 to v cc - 0.5 v port 4, 9 ? ? 1.0 av in = 0.5 to av cc - 0.5 v input leakage current ph7 | l in | ??1.0 av in = 0.5 to av cc - 0.5 v three-state leakage current (off state) port 1, 3, 7, port f, j to n, ph0 to ph3 | l tsi | ??1.0 a v in = 0.5 to av cc - 0.5 v input pull-up mos current port j ?l p 10 ? 300 av in = 0 v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 2.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. p35/sck1/scl0 and p34/sda0 are nmos push/pull outputs. to output high level signal from scl0 and sda0 (ice = 1), pull-up resistance must be connected externally. p35/sck1 and p34 (ice = 0) are driven high by nmos. to output high when v cc = 4.0v or less, pull-up resistance should be connected externally. 3. when ice = 0. to output low when bus drive function is selected is determined in table 26.4, bus drive characteristics.
rev. 2.0, 09/02, page 576 of 658 table 26.2 dc characteristics (2) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions vt - v cc x 0.2 ? ? v vt + ??v cc x 0.8 v schmitt trigger input voltage irq0 , irq1 , irq3 to irq5 , wkp0 to wkp7 vt + - vt - v cc x 0.05 ? ? v input high voltage res , stby , nmi, fwe, md2, md1 v ih v cc x 0.9 ? v cc + 0.3 v extal, port 1, 3, 7, f, j to n, ph0 to ph3 v cc x 0.8 ? v cc + 0.3 v port 4, 9, ph7 v cc x 0.8 ? v cc + 0.3 v input low voltage res , stby , fwe, md2, md1 v il - 0.3 ? v cc x 0.1 v nmi, extal, port 1, 3, 4, 7, 9, f, h, j to n - 0.3 ? v cc x 0.2 v output high voltage v oh v cc - 0.5 ? ? v i oh = - 200 a all output pins except p34 and p35, ph0 to ph3, and port j to n v cc - 1.0 ?? vi oh = - 1 ma p34 and p35 * 2 v cc - 2.7 ?? vi oh = - 100 a v cc - 0.5 ?? vi oh = - 200 a ph0 to ph3, port j to n v cc - 1.0 ? ? v i oh = - 1 ma
rev. 2.0, 09/02, page 577 of 658 item symbol min. typ. max. unit test conditions all output pins * 3 v ol ??0.4vi ol = 0.8 ma output low voltage port 7 ? ? 1.0 v i ol = 10 ma res ??1.0 a stby , nmi, fwe, md2, md1 ??1.0 a v in = 0.5 to v cc - 0.5 v port 4, 9 ? ? 1.0 av in = 0.5 to av cc - 0.5 v input leakage current ph7 | l in | ??1.0 a v in = 0.5 to av cc - 0.5 v three-state leakage current (off state) port 1, 3, 7, port f, j to n, ph0 to ph3 | l tsi | ??1.0 av in = 0.5 to av cc - 0.5 v input pull-up mos current port j ?l p 50 ? 300 av in = 0 v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 4.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. p35/sck1/scl0 and p34/sda0 are nmos push/pull outputs. to output high level signal from scl0 and sda0 (ice = 1), pull-up resistance must be connected externally. p35/sck1 and p34 (ice = 0) are driven high by nmos. 3. when ice = 0. to output low when bus drive function is selected is determined in table 26.4, bus drive characteristics.
rev. 2.0, 09/02, page 578 of 658 table 26.2 dc characteristics (3) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p32 to p35 ? ? 20 pf input capacitance all input pins except res , nmi, p32 to p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc * 4 ?18 v cc = 3.0 v 30 v cc = 5.5 v ma f = 13.5 mhz sleep mode ? 13 v cc = 3.0 v 22 v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? 10 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium-speed mode ( /32) ? 12 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ? 60 110 a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) subsleep mode ?50 90 a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) watch mode ? 4 25 a using 32.768 khz crystal resonator vcc = 3.0 v (lcd and tmr4 not used, wdt_1 operates)
rev. 2.0, 09/02, page 579 of 658 item symbol min. typ. max. unit test conditions ?0.5 vcc = 3.0 v 10 vcc = 5.5 v at a 50c 32.768 khz not used current consumption * 2 standby mode * 3 i cc * 4 ?? 50 vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion, d/a conversion, dtmf output al cc ?1.0 2.4 ma waiting for a/d conversion, d/a conversion, dtmf stopped ? 0.01 5.0 a reference current during a/d conversion, d/a conversion al cc ?1.0 2.2 ma waiting for a/d conversion, d/a conversion ? 0.01 5.0 a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the avcc, vref , and avss pins open. apply a voltage 2.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 3.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = 4.0 (ma) + 0.64 (ma/v) x vcc + 0.75 (ma/mhz) x f + 0.15 (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = 3.0 (ma) + 0.60 (ma/v) x vcc + 0.60 (ma/mhz) x f + 0.10 (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 580 of 658 table 26.2 dc characteristics (4) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p32 to p35 ? ? 20 pf input capacitance all input pins except res , nmi, p32 to p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc *4 ?tbd v cc = 3.0v tbd v cc = 5.5v ma f = 13.5 mhz sleep mode ? tbd v cc = 3.0v tbd v cc = 5.5v ma f = 13.5 mhz all modules stopped ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) watch mode ? tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd and tmr4 not used, wdt_1 operates)
rev. 2.0, 09/02, page 581 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 i cc *4 ?tbd vcc = 3.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion, d/a conversion, dtmf output al cc ?tbd tbd ma waiting for a/d conversion, d/a conversion, dtmf stopped ?tbd tbd a reference current during a/d conversion, d/a conversion al cc ?tbd tbd ma waiting for a/d conversion, d/a conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the avcc, vref , and avss pins open. apply a voltage 2.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 582 of 658 table 26.2 dc characteristics (5) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p32 to p35 ? ? 20 pf input capacitance all input pins except res , nmi, p32 to p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc *4 ?30 v cc = 5.0 v 40 v cc = 5.5 v ma f = 20.5 mhz sleep mode ? 22 v cc = 5.0 v 30 v cc = 5.5 v ma f = 20.5 mhz all modules stopped ? 15 ? ma f = 20.5 mhz, v cc = 5.0 v (reference values) medium-speed mode ( /32) ? 19 ? ma f = 20.5 mhz, v cc = 5.0 v (reference values) subactive mode ? 70 120 a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) subsleep mode ? 60 100 a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) watch mode ? 5 30 a using 32.768 khz crystal resonator vcc = 5.0 v (lcd and tmr4 not used, wdt_1 operates)
rev. 2.0, 09/02, page 583 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 i cc *4 ?1.0 vcc = 5.0 v 10 vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? 50 vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion, d/a conversion, dtmf output al cc ?1.5 2.5 ma waiting for a/d conversion, d/a conversion, dtmf stopped ? 0.01 5.0 a reference current during a/d conversion, d/a conversion al cc ?1.5 2.2 ma waiting for a/d conversion, d/a conversion ? 0.01 5.0 a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the avcc, vref , and avss pins open. apply a voltage 4.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = 4.0 (ma) + 0.64 (ma/v) x vcc+ 0.75 (ma/mhz) x f + 0.15 (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = 3.0 (ma) + 0.60 (ma/v) x vcc+ 0.60 (ma/mhz) x f + 0.10 (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 584 of 658 table 26.2 dc characteristics (6) ? preliminary ? condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p32 to p35 ? ? 20 pf input capacitance all input pins except res , nmi, p32 to p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc * 4 ?tbd v cc = 5.0 v tbd v cc = 5.5 v ma f = 20.5 mhz sleep mode ? tbd v cc = 5.0 v tbd v cc = 5.5 v ma f = 20.5 mhz all modules stopped ? tbd ? ma f = 20.5 mhz, v cc = 5.0 v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 20.5 mhz, v cc = 5.0 v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) watch mode ? tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd and tmr4 not used, wdt_1 operates)
rev. 2.0, 09/02, page 585 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 i cc * 4 ?tbd vcc = 5.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion, d/a conversion, dtmf output al cc ?tbd tbd ma waiting for a/d conversion, d/a conversion, dtmf stopped ?tbd tbd a reference current during a/d conversion, d/a conversion al cc ?tbd tbd ma waiting for a/d conversion, d/a conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the avcc, vref , and avss pins open. apply a voltage 4.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = vcc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 586 of 658 table 26.3 permissible output currents condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) item symbol min. typ. max. unit permissible output low current (per pin) port 7 i ol ??10ma scl1, scl0, sda1, sda0 ? ? 10 ma output pins except port 7, scl1, scl0, sda1, sda0 ??1.0ma permissible output low current (total) total of port 7 i ol ??30ma total of all output pins including port 7 ??60ma permissible output high current (per pin) all output pins ?i oh ??1.0ma permissible output high current (total) total of all output pins ? i oh ??30ma note: to protect chip reliability, do not exceed the output current values in table 26.3.
rev. 2.0, 09/02, page 587 of 658 table 26.4 bus drive characteristics (1) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl1, scl 0 , sda1, sda 0 condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl1, scl 0 , sda1, sda 0 item symbol min. typ. max. unit test conditions schmitt trigger input voltage vt - v cc 0.3 ? ? v vt + ??v cc 0.7 0.4 ? ? v cc = 4.0 to 5.5 v vt + - vt - v cc 0.05 ? ? v cc =2.7 to 4.0 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v input low voltage v il -0.5 ? v cc 0.3 v ?? 0.5 v i ol =8 ma, v cc =4.0 to 5.5 v output low voltage v ol ??0.4 i ol =3ma input capacitance c in ? ? 20 pf vin=0 v, f=1 mhz, t a =25c three-state leakage current (off state) | l sti | ?? 1.0 a v in =0.5 to v cc -0.5 sdl, sda output fall time t of 20 + 0.1cb ? 250 ns note: if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 2.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc
rev. 2.0, 09/02, page 588 of 658 table 26.4 bus drive characteristics (2) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl1, scl 0 , sda1, sda 0 condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl1, scl 0 , sda1, sda 0 item symbol min. typ. max. unit test conditions schmitt trigger input voltage vt - v cc 0.3 ? ? v vt + ??v cc 0.7 vt + - vt - 0.4 ? ? input high voltage v ih v cc 0.7 ? v cc + 0.5 v input low voltage v il -0.5 ? v cc 0.3 v ?? 0.5 v i ol =8 ma output low voltage v ol ?? 0.4 i ol =3 ma input capacitance c in ?? 20 pf v in =0 v, f=1 mhz, t a =25c three-state leakage current (off state) | l sti | ??1.0 a v in =0.5 to v cc -0.5 sdl, sda output fall time t of 20 + 0.1cb ? 250 ns note: if the a/d and d/a converters and dtmf generation circuit are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 4.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc
rev. 2.0, 09/02, page 589 of 658 26.2.3 ac characteristics figure 26.2 show, the test conditions for the ac characteristics. 5v r l r h c lsi output pin c=30pf: r l = 2.4k ? r h =12 ? input/output timing measurement levels ? low level : 0.8v  high level : 2.0v figure 26.2 output load circuit
rev. 2.0, 09/02, page 590 of 658 clock timing: table 26.5 lists the clock timing. table 26.5 clock timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768khz, 2 to 13.5mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768khz, 2 to 13.5mhz,t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a and b condition c and d 13.5mhz 20.5 mhz item symbol min. typ. max. min. typ. max. unit test conditions clock cycle time t cyc 74 ? 500 48.8 ? 100 ns clock oscillator settling time at reset (crystal) t osc1 20 ? ? 10 ? ? ms figure 26.5 clock oscillator settling time in software standby (crystal) t osc2 8 ? ? 8 ? ? ms figure 26.3 external clock settling delay time t dext 500 ?? 500 ?? s figure 26.5 sub clock oscillator settling time t osc3 ??2??2s sub clock oscillator frequency f sub ? 32.768 ? ? 32.768 ? khz sub clock ( sub ) cycle time t sub ? 30.5 ? ? 30.5 ? s
rev. 2.0, 09/02, page 591 of 658 control signal timing: table 26.6 lists the control signal timing. table 26.6 control signal timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) item symbol min. max. unit test conditions res pulse width t resw 20 ? t cyc figure 26.6 nmi pulse width (exiting software standby mode) t nmiw 200 ? ns figure 26.7 irq pulse width (exiting software standby mode) t irqw 200 ? ns
rev. 2.0, 09/02, page 592 of 658 timing of on-chip peripheral modules: table 26.7 lists the timing of on-chip peripheral modules. table 26.8 lists the i 2 c bus timing. table 26.7 timing of on-chip peripheral modules condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d item symbol min. max. min. max. unit test conditions tpu single edge t tckwh 1.5 ? 1.5 ? t cyc figure 26.8 timer clock pulse width both edges t tckwl 2.5 ? 2.5 ? single edge 1.5 ? 1.5 ? tmr_0 to tmr_3 timer clock pulse width both edges t tmcwh t tmcwl 2.5 ? 2.5 ? t cyc figure 26.9 tmr_4 timer clock pulse width t tmcwh t tmcwl 1.5 ? 1.5 ?t cyc sci input clock cycle asynchronous t scyc ?4 ? t cyc figure 26.10 synchronous ? 6 ? input clock pulse width t sckw 0.4 0.6 0.4 0.6 t scyc input clock rise time t sckf ? 1.5 ? 1.5 t cyc input clock fall time t sckf ? 1.5 ? 1.5 transmit data delay time t txd ? 75 ? 50 ns figure 26.11 receive data setup time (synchronous) t rxs 75 ? 50 ? ns receive data hold time (synchronous) t rxh 75 ? 50 ? ns
rev. 2.0, 09/02, page 593 of 658 table 26.8 i 2 c bus timing conditions: v cc = 2.7 v to 5.5 v, v ss = 0 v, = 5 mhz to maximum operating frequency t a = ?20c to +75c (regular specifications), t a = ?40c to +80c (wide-range specifications) item symbol min. typ. max. unit test conditions remarks scl input cycle time t scl 12t cyc ?? ns scl input high pulse width t sclh 3t cyc ?? ns scl input low pulse width t scll 5t cyc ?? ns scl, sda input rise time t sr ? ? 7.5t cyc * ns scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse elimination time t sp ??1t cyc ns sda input bus free time t buf 5t cyc ?? ns start condition input hold time t stah 3t cyc ?? ns retransmission start condition input setup time t stas 3t cyc ?? ns stop condition input setup time t stos 3t cyc ?? ns data input setup time t sdas 0.5t cyc ?? ns data input hold time t sdah 0??ns scl, sda load capacitance c b ? ? 400 pf figure 26.12 note: * t sr can be set to 7.5 t cyc or 17.5 t cyc according to the clock used for the i 2 c module. for details, see section 14.5 usage notes.
rev. 2.0, 09/02, page 594 of 658 26.2.4 a/d conversion characteristics table 26.9 lists the a/d conversion characteristics. table 26.9 a/d conversion characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d 13.5mhz 20.5 mhz item min. typ. max. min. typ. max. unit resolution 10 10 10 10 10 10 bits conversion time 9.6 ? ? 6.3 ? ? s analog input capacitance ? ? 20 ? ? 20 pf permissible signal-source impedance ? ? 5 ? ? 5 k ? nonlinearity error ? ? 6.0 ? ? 3.0 lsb offset error ? ? 4.0 ? ? 2.0 lsb full-scale error ? ? 4.0 ? ? 2.0 lsb quantization error ? ? 0.5 ? ? 0.5 lsb absolute accuracy ? ? 8.0 ? ? 4.0 lsb
rev. 2.0, 09/02, page 595 of 658 26.2.5 d/a conversion characteristics table 26.10 lists the d/a conversion characteristics. table 26.10 d/a conversion characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b, c, d item min. typ. max. unit test conditions resolution 888bits conversion time ? ? 10 s load capacitance: 20 pf absolute accuracy ? 2.0 3.0 lsb load resistance: 2 m ? ? ? 2.0 lsb load resistance: 4 m ?
rev. 2.0, 09/02, page 596 of 658 26.2.6 lcd characteristics table 26.11 lists the lcd characteristics. table 26.11 lcd characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d standard value standard value item symbol applicable pins test conditions min. typ. max. min. typ. max. unit notes segment driver step- down voltage v ds seg1 to seg40 id = 2 a??0.6??0.6v * 1 common driver step- down voltage v dc com1 to com4 id = 2 a??0.3??0.3v * 1 lcd power supply division resistor r lcd between v1 and v ss 40 360 1000 40 360 1000 k ? lcd voltage (step-up voltage circuit not used) v lcd v1 3.0 * 4 ?v cc 4.0 ? v cc v * 2 lcd input reference voltage (using step-up voltage circuit) * 3 v lcd3 v3 1.0 1.67 1.83 ? ? ? v v lcd2 v2 ? 2 v lcd3 ???? lcd voltage (using step-up voltage circuit) * 3 v lcd1 v1 no load ?3 v lcd3 ???? v reference value
rev. 2.0, 09/02, page 597 of 658 condition a, b condition c, d standard value standard value item symbol applicable pins test conditions min. typ. max. min. typ. max. unit notes lcd input reference power supply current (using step-up voltage circuit) * 3 i lcd3 v3 no load, frame frequency: 64 hz, v lcd3 = 1.67 v ?2.0???? a reference value notes: 1. voltage step-down between power supply pins v1, v2, v3, and v ss and segment pins. 2. if the lcd voltage is provided by an external power supply, the following relationship must be maintained: v cc v1 v2 v3 v ss . 3. the step-up voltage circuit should be used with 1/3 duty or 1/4 duty. 4. when the step-up voltage circuit is not used, the lowest value of v cc is vcc = v1 = 3.0v. use the step-up voltage circuit when vcc < 3.0v.
rev. 2.0, 09/02, page 598 of 658 26.2.7 dtmf characteristics table 26.12 lists the dtmf characteristics. table 26.12 dtmf characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.2 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.2 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 2.7 v* 1 to 5.5v, v ref = 2.7 v* 1 to av cc , v ss = av ss = 0 v, = 10 to 20.4 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 2.7 v* 1 to 5.5v, v ref = 2.7 v* 1 to av cc , v ss = av ss = 0 v, = 10 to 20.4 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) standard value item symbol applicable pins test conditions min. typ. max. unit notes dtmf output voltage (row side) v or toned av cc - gnd=2.7v r l =100k ? 750 924 ? mvrms figure 26.13 * 2 dtmf output voltage (column side) v oc toned av cc - gnd=2.7v r l =100k ? 770 945 ? mvrms figure 26.13 * 2 dtmf output distortion % disdt toned av cc - gnd=2.7v r l =100k ? ? 37%figure 26.13 dtmf output ratio db cr toned av cc - gnd=2.7v r l =100k ? ?2.5?dbfigure 26.13 notes: 1. when av cc = 2.7 to 4.0 v, and v ref = 2.7 to 4.0 v, dtmf is only available. 2. v or and v cc are output voltages when a single waveform is output.
rev. 2.0, 09/02, page 599 of 658 26.2.8 flash memory characteristics table 26.13 shows the flash memory characteristics. table 26.13 flash memory characteristics conditions:v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?25c to +75c (programming/erasing operating temperature range: regular specification) item symbol min. typ. max. unit test condition programming time * 1 * 2 * 4 t p ? 30 200 ms/ 128 bytes erase time * 1 * 3 * 5 t e ? 100 1200 ms/block count of rewriting n wec 100 * 6 10000 * 7 ?times data retention time t drp * 8 10 ? ? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s wait time after p1 bit setting * 1, * 4 t sp10 810 12 s t sp30 28 30 32 s6 n 1 t sp200 198 200 202 s 1000 n 7 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 44 ? s wait time after pv1 bit setting * 1 t spv 22 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 100 100 ? s wait time after swe1 bit clear t cswe ?? ? s n1 ?? 6 * 4 times maximum programming count * 1 * 4 n2 ?? 994 * 4 times erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum erase count * 1 * 5 n ?? 100 times
rev. 2.0, 09/02, page 600 of 658 notes: 1. make each time setting in accordance with the program or erase algorithm. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register (flmcr1) is set. it does not include the programming verification time.) 3. block erase time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. the maximum programming time value (t p (max.)): t p (max.) = wait time after p1 bit setting (t sp ) x maximum programming count (n) (t sp30 + t sp10 ) x 6 + (t sp200 ) x 994 5. for the maximum erase time (t e (max.)), the following relationship applies between the wait time after e1 bit setting (t se ) and the maximum erase count (n): t e (max.) = wait time after e1 bit setting (t se ) x maximum erase count (n) 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value. 26.3 electrical characteristics of the h8s/2264 series 26.3.1 absolute maximum ratings table 26.14 lists the absolute maximum ratings. table 26.14 absolute maximum ratings item symbol value unit power supply voltage v cc ?0.3 to +7.0 v cv cc ?0.3 to +4.3 v input voltage (except port 4, 9, ph7) v in ?0.3 to v cc +0.3 v input voltage (port 4, 9, ph7) v in ?0.3 to av cc +0.3 v reference voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +7.0 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 * c wide-range specifications: ?40 to +85 * c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. note: * operating temperature range for flash memory programming/erasing is t a = -20 to +75c.
rev. 2.0, 09/02, page 601 of 658 26.3.2 dc characteristics table 26.15 lists the dc characteristics. table 26.16 lists the permissible output currents. table 26.17 lists the bus drive characteristics. table 26.15 dc characteristics (1) ? preliminary ? condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions vt - v cc x 0.2 ? ? v vt + ??v cc x 0.8 v vt + - vt - v cc x 0.05 ? ? v vcc = 4.0 to 5.5 v schmitt trigger input voltage irq0 , irq1 , irq3 , irq4 , wkp0 to wkp7 v cc x 0.04 ? ? v vcc = 2.7 to 4.0 v input high voltage res , stby , nmi, fwe, md2, md1 v ih v cc x 0.9 ? v cc + 0.3 v extal * 4 , port 1, 3, 7, f, j to l, ph0 to ph5 v cc x 0.8 ? v cc + 0.3 v port 4, 9, ph7 v cc x 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2, md1 v il - 0.3 ? v cc x 0.1 v nmi, extal * 4 , port 1, 3, 4, 7, 9, f, h, j to l - 0.3 ? v cc x 0.2 v output high voltage v oh v cc - 0.5 ? ? v i oh = - 200 a all output pins except p34 and p35 v cc - 1.0 ? ? v i oh = - 1 ma p34 and p35 * 2 v cc - 2.7 ? ? v i oh = - 100 a v cc = 4.0 to 5.5 v all output pins * 3 v ol ??0.4vi ol = - 0.8 ma i ol = 5 ma output low voltage port 7 ? ? 1.0 v i ol = 10 ma, v cc = 4.0 to 5.5 v
rev. 2.0, 09/02, page 602 of 658 item symbol min. typ. max. unit test conditions res ??1.0 a stby , nmi, fwe, md2, md1 ??1.0 a v in = 0.5 to v cc - 0.5 v port 4, 9 ? ? 1.0 a v in = 0.5 to av cc - 0.5 v input leakage current ph7 | l in | ??1.0 av in = 0.5 to av cc - 0.5 v three-state leakage current (off state) port 1, 3, 7, port f, j to n, ph0 to ph5 | l tsi | ??1.0 a v in = 0.5 to av cc - 0.5 v input pull-up mos current port j ?l p 10 ? 300 av in = 0 v notes: 1. if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 2.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. p35/sck1/scl0 and p34/sda0 are nmos push/pull outputs. to output high level signal from scl0 and sda0 (ice = 1), pull-up resistors must be connected externally. p35/sck1 and p34 (ice = 0) are driven high by nmos. to output high when v cc = 4.0v or less, pull-up resistors should be connected externally. 3. when ice = 0. the output low level when bus drive function is selected is indicated in table 26.17, bus drive characteristics. 4. supported only by the h8s/2264 and h8s/2262. in the h8s/2264r and h8s/2262r, an external clock is disabled.
rev. 2.0, 09/02, page 603 of 658 table 26.15 dc characteristics (2) ? preliminary ? condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions vt - v cc x 0.2 ? ? v vt + ??v cc x 0.8 v schmitt trigger input voltage irq0 , irq1 , irq3 , irq4 , wkp0 to wkp7 vt + - vt - v cc x 0.05 ? ? v input high voltage res , stby , nmi, fwe, md2, md1 v ih v cc x 0.9 ? v cc + 0.3 v extal * 4 , port 1, 3, 7, f, j to l, ph0 to ph5 v cc x 0.8 ? v cc + 0.3 v port 4, 9, ph7 v cc x 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2, md1 v il - 0.3 ? v cc x 0.1 v nmi, extal * 4 , port 1, 3, 4, 7, 9, f, h, j to l - 0.3 ? v cc x 0.2 v output high voltage v oh v cc - 0.5 ? ? v i oh = - 200 a all output pins except p34 and p35 v cc - 1.0 ? ? v i oh = - 1 ma p34 and p35 * 2 v cc - 2.7 ? ? v i oh = - 100 a all output pins * 3 v ol ??0.4vi ol = 0.8 ma output low voltage port 7 ? ? 1.0 v i ol = 10 ma res ??1.0 a stby , nmi, fwe, md2, md1 ??1.0 a v in = 0.5 to v cc - 0.5 v port 4, 9 ? ? 1.0 av in = 0.5 to av cc - 0.5 v input leakage current ph7 | l in | ??1.0 a v in = 0.5 to av cc - 0.5 v
rev. 2.0, 09/02, page 604 of 658 item symbol min. typ. max. unit test conditions three-state leakage current (off state) port 1, 3, 7, port f, j to l, ph0 to ph5 | l tsi | ??1.0 av in = 0.5 to av cc - 0.5 v input pull-up mos current port j ?l p 50 ? 300 av in = 0 v notes: 1. if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 4.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. p35/sck1/scl0 and p34/sda0 are nmos push/pull outputs. to output high level signal from scl0 and sda0 (ice = 1), pull-up resistors must be connected externally. p35/sck1 and p34 (ice = 0) are driven high by nmos. 3. when ice = 0. the output low level when bus drive function is selected is indicated in table 26.17, bus drive characteristics. 4. supported only by the h8s/2264 and h8s/2262. in the h8s/2264r and h8s/2262r, an external clock is disabled.
rev. 2.0, 09/02, page 605 of 658 table 26.15 dc characteristics (3) ? preliminary ? condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p34 and p35 ? ? 20 pf input capacitance all input pins except res , nmi, p34, and p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc *4 ?tbd v cc = 3.0 v tbd v cc = 5.5 v ma f = 13.5 mhz sleep mode ? tbd v cc = 3.0 v tbd v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd lighting) current consumption * 2 watch mode ? tbd tbd a using 32.768 khz crystal resonator vcc = 3.0 v (lcd not used, wdt_1 operates)
rev. 2.0, 09/02, page 606 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 watch mode i cc *4 ?tbd ? a using 32.768 khz crystal resonator vcc = 3.0 v (lcd not used, wdt_1 operates) wdt_1 overflow cycle 2 min selected (reference value) ?tbd vcc = 3.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a, 32.768 khz not used analog power supply current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a reference current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d converter is not used, do not leave the avcc, vref , and avss pins open. apply a voltage 2.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 3.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 607 of 658 table 26.15 dc characteristics (4) ? preliminary ? condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p34 and p35 ? ? 20 pf input capacitance all input pins except res , nmi, p34, and p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc * 4 ?tbd v cc = 3.0 v tbd v cc = 5.5 v ma f = 13.5 mhz sleep mode ? tbd v cc = 3.0 v tbd v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 2.7 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 2.7 v (lcd lighting)
rev. 2.0, 09/02, page 608 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 watch mode i cc * 4 ?tbd tbd a using 32.768 khz crystal resonator vcc = 2.7 v (lcd not used, wdt_1 operates) ?tbd ? a using 32.768 khz crystal resonator vcc = 2.7 v (lcd not used, wdt_1 operates) wdt_1 overflow cycle 2 min selected (reference value) ?tbd vcc = 3.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a reference current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d converter is not used, do not leave the avcc, vref , and avss pins open. apply a voltage 2.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 609 of 658 table 26.15 dc characteristics (5) ? preliminary ? condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p34 and p35 ? ? 20 pf input capacitance all input pins except res , nmi, p34, and p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc * 4 ?tbd v cc = 5.0v tbd v cc = 5.5v ma f = 20.5 mhz sleep mode ? tbd v cc = 5.0v tbd v cc = 5.5v ma f = 20.5 mhz all modules stopped ? tbd ? ma f = 20.5 mhz, v cc = 5.0v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 20.5 mhz, v cc = 5.0v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting)
rev. 2.0, 09/02, page 610 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 watch mode i cc * 4 ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd not used, wdt_1 operates) ?tbd ? a using 32.768 khz crystal resonator vcc = 5.0 v (lcd not used, wdt_1 operates), wdt_1 overflow cycle 2 min selected (reference value) i cc * 4 ?tbd vcc = 5.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a reference current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d converter is not used, do not leave the avcc, vref , and avss pins open. apply a voltage 4.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = v cc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc+ tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc+ tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 611 of 658 table 26.15 dc characteristics (6) ? preliminary ? condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min. typ. max. unit test conditions res c in ? ? 30 pf nmi ? ? 30 pf p34 and p35 ? ? 20 pf input capacitance all input pins except res , nmi, p34, and p35 ? ? 15 pf v in = 0 v f = 1 mhz ta = 25c current consumption * 2 normal operation i cc * 4 ?tbd v cc = 5.0 v tbd v cc = 5.5 v ma f = 20.5 mhz sleep mode ? tbd v cc = 5.0 v tbd v cc = 5.5 v ma f = 20.5 mhz all modules stopped ? tbd ? ma f = 20.5 mhz, v cc = 5.0v (reference values) medium-speed mode ( /32) ? tbd ? ma f = 20.5 mhz, v cc = 5.0v (reference values) subactive mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting) subsleep mode ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd lighting)
rev. 2.0, 09/02, page 612 of 658 item symbol min. typ. max. unit test conditions current consumption * 2 watch mode i cc * 4 ?tbd tbd a using 32.768 khz crystal resonator vcc = 5.0 v (lcd not used, wdt_1 operates) ?tbd ? a using 32.768 khz crystal resonator vcc = 5.0 v (lcd not used, wdt_1 operates), wdt_1 overflow cycle 2 min selected (reference value) 2 ?tbd vcc = 5.0 v tbd vcc = 5.5 v at a 50c 32.768 khz not used standby mode * 3 ?? tbd vcc = 5.5 v 50c < t a 32.768 khz not used analog power supply current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a reference current during a/d conversion al cc ?tbd tbd ma waiting for a/d conversion ?tbd tbd a ram standby voltage v ram 2.0 ? ? v notes: 1. if the a/d converter is not used, do not leave the avcc, vref , and avss pins open. apply a voltage 4.0 to 5.5 v to the avcc and vref pins by connecting them to v cc , for instance. set v ref av cc . 2. current consumption values are for v ih min. = vcc ? 0.2 v, v il max. = 0.2 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min. = v cc ? 0.2, and v il max. = 0.2 v. 4. i cc depends on v cc and f as follows (reference): i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) x v cc x f (normal operation) i cc max. = tbd (ma) + tbd (ma/v) x vcc + tbd (ma/mhz) x f + tbd (ma/(mhz ? v)) v cc x f (sleep mode)
rev. 2.0, 09/02, page 613 of 658 table 26.16 permissible output currents condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) item symbol min. typ. max. unit permissible output low current (per pin) port 7 i ol ??10ma scl0, sda0 ? ? 10 ma output pins except port 7, scl0, sda0 ??1.0ma permissible output low current (total) total of port 7 i ol ??30ma total of all output pins including port 7 ??60ma permissible output high current (per pin) all output pins ?i oh ??1.0ma permissible output high current (total) total of all output pins ? i oh ??30ma note: to protect chip reliability, do not exceed the output current values in table 26.16.
rev. 2.0, 09/02, page 614 of 658 table 26.17 bus drive characteristics (1) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl 0 , sda 0 condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl 0 , sda 0 item symbol min. typ. max. unit test conditions schmitt trigger input voltage vt - v cc 0.3 ? ? v vt + ??v cc 0.7 0.4 ? ? v cc = 4.0 to 5.5 v vt + - vt - v cc 0.05 ? ? v cc =2.7 to 4.0 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v input low voltage v il -0.5 ? v cc 0.3 v ?? 0.5 v i ol =8 ma, v cc =4.0 to 5.5 v output low voltage v ol ??0.4 i ol =3 ma input capacitance c in ? ? 20 pf vin=0 v, f=1 mhz, t a =25c three-state leakage current (off state) | l sti | ?? 1.0 a v in =0.5 to v cc -0.5 sdl, sda output fall time t of 20 + 0.1cb ? 250 ns note: if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 4.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc .
rev. 2.0, 09/02, page 615 of 658 table 26.17 bus drive characteristics (2) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl 0 , sda 0 condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 , target pins: scl 0 , sda 0 item symbol min. typ. max. unit test conditions schmitt trigger input voltage vt - v cc 0.3 ? ? v vt + ??v cc 0.7 vt + - vt - 0.4 ? ? input high voltage v ih v cc 0.7 ? v cc + 0.5 v input low voltage v il -0.5 ? v cc 0.3 v ?? 0.5 v i ol =8ma output low voltage v ol ?? 0.4 i ol =3ma input capacitance c in ? ? 20 pf vin=0 v, f=1 mhz, t a =25c three-state leakage current (off state) | l sti | ??1.0 a v in =0.5 to v cc -0.5 sdl, sda output fall time t of 20 + 0.1cb ? 250 ns note: if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage 4.0 v to 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 26.3.3 ac characteristics figure 26.3 shows the test conditions for the ac characteristics. 5v r l r h c lsi output pin c=30pf: r l = 2.4k ? r h =12 ? input/output timing measurement levels  low level : 0.8v  high level : 2.0v figure 26.3 output load circuit
rev. 2.0, 09/02, page 616 of 658 clock timing: table 26.18 lists the clock timing. table 26.18 clock timing ? preliminary ? condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768khz, 2 to 13.5mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (mask-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768khz, 2 to 13.5mhz,t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (mask-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a and b condition c and d 13.5mhz 20.5 mhz item symbol min. typ. max. min. typ. max. unit test conditions clock cycle time t cyc 74 ? 500 48.8 ? 100 ns output clock high width t och 25 ? ? 16 ? ? ns figure 26.4 output clock low width t ocl 25 ? ? 16 ? ? output clock rising time t ocr ? ?10 ? ?8 output clock falling time t ocf ? ?10 ? ?8 clock oscillator settling time at reset (crystal) t osc1 20 ?? 10 ?? ms figure 26.5 h8s/2264, h8s/2262 clock oscillator settling time in software standby (crystal) t osc2 8 ?? 8 ?? ms figure 22.3 h8s/2264, h8s/2262 clock oscillator settling time at reset or in software standby (ceramic) t osc1 ? tbd tbd ? tbd tbd s figure 26.5 h8s/2264r, h8s/2262r tbd ( = 2 to 4 mhz) tbd ( = 2 to 4 mhz) clock oscillator settling time at reset or in software standby (crystal) t osc1 ? tbd tbd ?tbdtbd s figure 26.5 h8s/2264r, h8s/2262r
rev. 2.0, 09/02, page 617 of 658 condition a and b condition c and d 13.5mhz 20.5 mhz item symbol min. typ. max. min. typ. max. unit test conditions external clock settling time * t dext 500 ?? 500 ?? s figure 26.5 sub clock oscillator settling time t osc3 ??2??2s sub clock oscillator frequency f sub ? 32.768 ? ? 32.768 ? khz sub clock ( sub ) cycle time t sub ? 30.5 ? ? 30.5 ? s note: * supported only by the h8s/2264 and h8s/2262. in the h8s/2264r and h8s/2262r, an external clock input is disabled. control signal timing: table 26.19 lists the control signal timing. table 26.19 control signal timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) item symbol min. max. unit test conditions res pulse width t resw 20 ? t cyc figure 26.6 nmi pulse width (exiting software standby mode) t nmiw 200 ? ns figure 26.7 irq pulse width (exiting software standby mode) t irqw 200 ? ns
rev. 2.0, 09/02, page 618 of 658 timing of on-chip peripheral modules: table 26.20 lists the timing of on-chip peripheral modules. table 26.21 lists the i 2 c bus timing. table 26.20 timing of on-chip peripheral modules condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d item symbol min. max. min. max. unit test conditions tpu single edge t tckwh 1.5 ? 1.5 ? t cyc figure 26.8 timer clock pulse width both edges t tckwl 2.5 ? 2.5 ? single edge 1.5 ? 1.5 ? tmr_0, tmr_1 timer clock pulse width both edges t tmcwh t tmcwl 2.5 ? 2.5 ? t cyc figure 26.9 sci input clock cycle asynchronous t scyc 4?4 ? t cyc figure 26.10 synchronous 6 ? 6 ? input clock pulse width t sckw 0.4 0.6 0.4 0.6 t scyc input clock rise time t sckf ? 1.5 ? 1.5 t cyc input clock fall time t sckf ? 1.5 ? 1.5 transmit data delay time t txd ? 75 ? 50 ns figure 26.11 receive data setup time (synchronous) t rxs 75 ? 50 ? ns receive data hold time (synchronous) t rxh 75 ? 50 ? ns
rev. 2.0, 09/02, page 619 of 658 table 26.21 i 2 c bus timing conditions: v cc = 2.7 v to 5.5 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20c to +75c (regular specifications), t a = ?40c to +80c (wide-range specifications) item symbol min. typ. max. unit test conditions remarks scl input cycle time t scl 12t cyc ?? ns scl input high pulse width t sclh 3t cyc ?? ns scl input low pulse width t scll 5t cyc ?? ns scl, sda input rise time t sr ? ? 7.5t cyc * ns scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse elimination time t sp ??1t cyc ns sda input bus free time t buf 5t cyc ?? ns start condition input hold time t stah 3t cyc ?? ns retransmission start condition input setup time t stas 3t cyc ?? ns stop condition input setup time t stos 3t cyc ?? ns data input setup time t sdas 0.5t cyc ?? ns data input hold time t sdah 0??ns scl, sda load capacitance c b ? ? 400 pf figure 26.12 note: * t sr can be set to 7.5 t cyc or 17.5 t cyc according to the clock used for the i 2 c module. for details, see section 14.5 usage notes.
rev. 2.0, 09/02, page 620 of 658 26.3.4 a/d conversion characteristics table 26.22 lists the a/d conversion characteristics. table 26.22 a/d conversion characteristics ? preliminary ? condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d 13.5mhz 20.5 mhz item min. typ. max. min. typ. max. unit resolution 10 10 10 10 10 10 bits conversion time 9.6 ? ? 6.3 ? ? s analog input capacitance ? ? 20 ? ? 20 pf permissible signal-source impedance ? ? 5 ? ? 5 k ? nonlinearity error ? ? 6.0 ? ? 3.0 lsb offset error ? ? 4.0 ? ? 2.0 lsb full-scale error ? ? 4.0 ? ? 2.0 lsb quantization error ? ? 0.5 ? ? 0.5 lsb absolute accuracy ? ? 8.0 ? ? 4.0 lsb
rev. 2.0, 09/02, page 621 of 658 26.3.5 lcd characteristics table 26.23 lists the lcd characteristics. table 26.23 lcd characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked-rom version): v cc = 2.7 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition c (f-ztat version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition d (masked-rom version): v cc = 4.0v to 5.5 v, av cc = 4.0v to 5.5v, v ref = 4.0v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 20.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition a, b condition c, d standard value standard value item symbol applicable pins test conditions min. typ. max. min. typ. max. unit notes segment driver step- down voltage v ds seg1 to seg40 id = 2 a??0.6??0.6v * 1 common driver step- down voltage v dc com1 to com4 id = 2 a??0.3??0.3v * 1 lcd power supply division resistor r lcd between v1 and v ss 40 360 1000 40 360 1000 k ? lcd voltage v lcd v1 3.0 ? v cc 4.0 ? v cc v * 2 notes: 1. voltage step-down between power supply pins v1, v2, v3, and v ss and segment pins. 2. if the lcd voltage is provided by an external power supply, the following relationship must be maintained: v cc v1 v2 v3 v ss .
rev. 2.0, 09/02, page 622 of 658 26.3.6 flash memory characteristics table 26.24 shows the flash memory characteristics. table 26.24 flash memory characteristics ? ? ? ? preliminary ? ? ? ? conditions:v cc = 3.0 v to 5.5 v, av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?25c to +75c (programming/erasing operating temperature range: regular specification) item symbol min. typ. max. unit test condition programming time * 1 * 2 * 4 t p ? 10 200 ms/ 128 bytes erase time * 1, * 3, * 5 t e ? 100 1200 ms/block count of rewriting n wec 100 * 6 10000 * 7 ?times data retention time t drp * 8 10 ? ? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s wait time after p1 bit setting * 1 * 4 t sp10 810 12 s t sp30 28 30 32 s6 n 1 t sp200 198 200 202 s 1000 n 7 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 44 ? s wait time after pv1 bit setting * 1 t spv 22 ? s wait time after h?ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 100 100 ? s wait time after swe1 bit clear t cswe ?? ? s n1 ?? 6 * 4 times maximum programming count * 1 * 4 n2 ?? 994 * 4 times erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s
rev. 2.0, 09/02, page 623 of 658 item symbol min. typ. max. unit test condition erase wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum erase count * 1, * 5 n ?? 100 times notes: 1. make each time setting in accordance with the program or erase algorithm. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register (flmcr1) is set. it does not include the programming verification time.) 3. block erase time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. the maximum programming time value (t p (max.)): t p (max.) = wait time after p1 bit setting (t sp ) x maximum programming count (n) (t sp30 + t sp10 ) x 6 + (t sp200 ) x 994 5. for the maximum erase time (t e (max.)), the following relationship applies between the wait time after e1 bit setting (t se ) and the maximum erase count (n): t e (max.) = wait time after e1 bit setting (t se ) x maximum erase count (n) 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data retention characteristics when rewriting is performed within the range of specifications including minimum value.
rev. 2.0, 09/02, page 624 of 658 26.4 operation timing operation timings are shown below. 26.4.1 clock timing clock timing is shown below. output clock timing (supported only by the h8s/2264 series): figure 26.4 shows the output clock timing. pin t och t ocl t ocr t ocf figure 26.4 output clock timing oscillator settling timing: figure 26.5 shows the oscillator settling timing. t osc1 t dext extal vcc internal clock t dext t osc1 figure 26.5 oscillator settling timing
rev. 2.0, 09/02, page 625 of 658 26.4.2 control signal timings control signal timings are shown below. ? reset input timing figure 26.6 shows the reset input timing. ? interrupt input timing figure 26.7 shows the nmi, irq interrupt reset input timing. t resw res figure 26.6 reset input timing nmi irq t nmiw t irqw figure 26.7 interrupt input timing 26.4.3 timing of on-chip peripheral modules figures 26.8 to 26.12 show timing of on-chip peripheral modules. tclka to tclkc, tclkd * note: * supported only by the h8s/2268 series. t tckwh t tckwl figure 26.8 tpu clock input timing
rev. 2.0, 09/02, page 626 of 658 tmci01, tmci23 * , tmci4 * t tckwh t tckwl note: * supported only by the h8s/2268 series. figure 26.9 8-bit timer clock input timing sck0 to sck2 t sckw t sckr t sckf t scyc figure 26.10 sck clock input timing txd0 to txd2 (transmit data) rxd0 to rxd2 (receive data) sck0 to sck2 t rxs t rxh t txd figure 26.11 sci input/output timing (clock synchronous mode)
rev. 2.0, 09/02, page 627 of 658 t buf t stah t stas t sp t stos t sclh t scll t sf t sr t scl t sdah t sdas p * 1 s * 1 s r * 1 v ih v il sda0 to sda1 * 2 scl0 to scl1 * 2 s, p, and sr indicate the following conditions. s : start condition p : stop condition sr : retransmission start condition supported only by the h8s/2268 series. * 1. * 2. note: figure 26.12 i 2 c bus interface input/output timing (option) toned gnd r l 100k figure 26.13 toned load circuit (supported only by the h8s/2268 series) 26.5 usage note the f-ztat and masked rom versions both satisfy the electrical characteristics shown in this manual, but actual electrical characteristic values, operating margins, noise margins, and other properties may vary due to differences in manufacturing process, on-chip rom, layout patterns, and so on. when system evaluation testing is carried out using the f-ztat version, the same evaluation testing should also be conducted for the masked rom version when changing over to that version.
rev. 2.0, 09/02, page 628 of 658
rev. 2.0, 09/02, page 629 of 658 appendix a i/o port states in each pin state a.1 i/o port state in each pin state of the h8s/2268 series port name reset hardware standby mode software standby mode watch mode program execution state sleep mode subsleep mode port 1 t t keep keep i/o port port 3 t t keep keep i/o port port 4 t t t t i/o port port 7 t t keep keep i/o port p97/da1 p96/da0 t t [daoen = 1] keep [daoen = 0] t [daoen = 1] keep [daoen = 0] t input port port f t t keep keep i/o port ph7 t t t t input port ph3 to ph0 t t [common output] port [otherwise] keep [common output] com4 to com1 [otherwise] keep [common output] com4 to com1 [otherwise] i/o port port j t t [segment output] port [otherwise] keep [segment output] seg8 to seg1 [otherwise] keep [segment output] seg8 to seg1 [otherwise] i/o port port k t t [segment output] port [otherwise] keep [segment output] seg16 to seg9 [otherwise] keep [segment output] seg16 to seg9 [otherwise] i/o port port l t t [segment output] port [otherwise] keep [segment output] seg24 to seg17 [otherwise] keep [segment output] seg24 to seg17 [otherwise] i/o port port m t t [segment output] port [otherwise] keep [segment output] seg32 to seg25 [otherwise] keep [segment output] seg32 to seg25 [otherwise] i/o port
rev. 2.0, 09/02, page 630 of 658 port name reset hardware standby mode software standby mode watch mode program execution state sleep mode port n t t [segment output] port [otherwise] keep [segment output] seg40 to seg33 [otherwise] keep [segment output] seg40 to seg33 [otherwise] i/o port a.2 i/o port state in each pin state of the h8s/2264 series port name reset hardware standby mode software standby mode watch mode program execution state sleep mode subsleep mode port 1 t t keep keep i/o port port 3 t t keep keep i/o port port 4 t t t t input port port 7 t t keep keep i/o port port 9 t t t t input port port f t t keep keep i/o port ph7 t t t t input port ph5 t t keep keep i/o port ph4 t t [clock output] h [otherwise] keep [clock output] [otherwise] keep [clock output] * [otherwise] i/o port ph3 to ph0 t t [common output] port [otherwise] keep [common output] com4 to com1 [otherwise] keep [common output] com4 to com1 [otherwise] i/o port port j t t [segment output] port [otherwise] keep [segment output] seg8 to seg1 [otherwise] keep [segment output] seg8 to seg1 [otherwise] i/o port port k t t [segment output] port [otherwise] keep [segment output] seg16 to seg9 [otherwise] keep [segment output] seg16 to seg9 [otherwise] i/o port
rev. 2.0, 09/02, page 631 of 658 port name reset hardware standby mode software standby mode watch mode program execution state sleep mode subsleep mode port l t t [segment output] port [otherwise] keep [segment output] seg24 to seg17 [otherwise] keep [segment output] seg24 to seg17 [otherwise] i/o port seg40 to seg25 t t t [segment output] seg40 to seg25 [otherwise] t [segment output] seg40 to seg25 [otherwise] t legend h: high level t: high-impedance keep: input port becomes high-impedance, output port retains state port: determined by port setting (input is high-impedance) note: * the i/o port state at the clock output is high, if the operation shifts to sleep mode while all modules are sopped (mstpcr = h?ffffffff).
rev. 2.0, 09/02, page 632 of 658 appendix b product codes ? h8s/2268 series product type product code mark code package (hitachi package code) operating voltage hd6432268(a ** )te 100-pin tqfp (tfp-100b) hd6432268(a ** )tf 100-pin tqfp (tfp-100g) hd6432268(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432268(f ** )te 100-pin tqfp (tfp-100b) hd6432268(f ** )tf 100-pin tqfp (tfp-100g) standard product hd6432268 hd6432268(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432268w(a ** )te 100-pin tqfp (tfp-100b) hd6432268w(a ** )tf 100-pin tqfp (tfp-100g) hd6432268w(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432268w(f ** )te 100-pin tqfp (tfp-100b) hd6432268w(f ** )tf 100-pin tqfp (tfp-100g) h8s/2268 (regular oscillation) masked- rom version version with on-chip i 2 c bus interface hd6432268 w hd6432268w(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 633 of 658 product type product code mark code package (hitachi package code) operating voltage hd64f2268te13 100-pin tqfp (tfp-100b) hd64f2268tf13 100-pin tqfp (tfp-100g) hd64f2268fa13 100-pin qfp (fp-100b) 3.0 v to 5.5 v hd64f2268te20 100-pin tqfp (tfp-100b) hd64f2268tf20 100-pin tqfp (tfp-100g) h8s/2268 (regular oscillation) f-ztat version standard product hd64f2268 hd64f2268fa20 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432266(a ** )te 100-pin tqfp (tfp-100b) hd6432266(a ** )tf 100-pin tqfp (tfp-100g) hd6432266(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432266(f ** )te 100-pin tqfp (tfp-100b) hd6432266(f ** )tf 100-pin tqfp (tfp-100g) h8s/2266 (regular oscillation) masked- rom version standard product hd6432266 hd6432266(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 634 of 658 product type product code mark code package (hitachi package code) operating voltage hd6432266w(a ** )te 100-pin tqfp (tfp-100b) hd6432266w(a ** )tf 100-pin tqfp (tfp-100g) hd6432266w(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432266w(f ** )te 100-pin tqfp (tfp-100b) hd6432266w(f ** )tf 100-pin tqfp (tfp-100g) masked- rom version version with on-chip i 2 c bus interface hd6432266 w hd6432266w(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd64f2266te13 100-pin tqfp (tfp-100b) hd64f2266tf13 100-pin tqfp (tfp-100g) hd64f2266fa13 100-pin qfp (fp-100b) 3.0 v to 5.5 v hd64f2266te20 100-pin tqfp (tfp-100b) HD64F2266TF20 100-pin tqfp (tfp-100g) h8s/2266 (regular oscillation) f-ztat version standard product hd64f2266 hd64f2266fa20 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 635 of 658 product type product code mark code package (hitachi package code) operating voltage hd6432265(a ** )te 100-pin tqfp (tfp-100b) hd6432265(a ** )tf 100-pin tqfp (tfp-100g) hd6432265(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432265(f ** )te 100-pin tqfp (tfp-100b) hd6432265(f ** )tf 100-pin tqfp (tfp-100g) standard product hd6432265 hd6432265(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432265w(a ** )te 100-pin tqfp (tfp-100b) hd6432265w(a ** )tf 100-pin tqfp (tfp-100g) hd6432265w(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432265w(f ** )te 100-pin tqfp (tfp-100b) hd6432265w(f ** )tf 100-pin tqfp (tfp-100g) h8s/2265 (regular oscillation) masked- rom version version with on-chip i 2 c bus interface hd6432265 w hd6432265w(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 636 of 658 product type product code mark code package (hitachi package code) operating voltage hd64f2265te13 100-pin tqfp (tfp-100b) hd64f2265tf13 100-pin tqfp (tfp-100g) hd64f2265fa13 100-pin qfp (fp-100b) 3.0 v to 5.5 v hd64f2265te20 100-pin tqfp (tfp-100b) hd64f2265tf20 100-pin tqfp (tfp-100g) h8s/2265 (regular oscillation) f-ztat version standard product hd64f2265 hd64f2265fa20 100-pin qfp (fp-100b) 4.0 v to 5.5 v legend (a ** ), (f ** ): rom code note: some products above are in the developing or planning stage. please contact hitachi agency to conform the present state of each product.
rev. 2.0, 09/02, page 637 of 658 ? h8s/2264 series product type product code mark code package (hitachi package code) operating voltage hd6432264(a ** )te 100-pin tqfp (tfp-100b) hd6432264(a ** )tf 100-pin tqfp (tfp-100g) hd6432264(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432264(f ** )te 100-pin tqfp (tfp-100b) hd6432264(f ** )tf 100-pin tqfp (tfp-100g) standard product hd6432264 hd6432264(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432264w(a ** )te 100-pin tqfp (tfp-100b) hd6432264w(a ** )tf 100-pin tqfp (tfp-100g) hd6432264w(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432264w(f ** )te 100-pin tqfp (tfp-100b) hd6432264w(f ** )tf 100-pin tqfp (tfp-100g) h8s/2264 (regular oscillation) masked- rom version version with on-chip i 2 c bus interface hd6432264 w hd6432264w(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 638 of 658 product type product code mark code package (hitachi package code) operating voltage hd64f2264te13 100-pin tqfp (tfp-100b) hd64f2264tf13 100-pin tqfp (tfp-100g) hd64f2264fa13 100-pin qfp (fp-100b) 3.0 v to 5.5 v hd64f2264te20 100-pin tqfp (tfp-100b) hd64f2264tf20 100-pin tqfp (tfp-100g) h8s/2264 (regular oscillation) f-ztat version standard product hd64f2264 hd64f2264fa20 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432264r(a ** )te 100-pin tqfp (tfp-100b) hd6432264r(a ** )tf 100-pin tqfp (tfp-100g) hd6432264r(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432264r(f ** )te 100-pin tqfp (tfp-100b) hd6432264r(f ** )tf 100-pin tqfp (tfp-100g) h8s/2264r (oscillation stabilization time shortened) masked- rom version standard product hd6432264 r hd6432264r(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 639 of 658 product type product code mark code package (hitachi package code) operating voltage hd6432264rw(a ** )t e 100-pin tqfp (tfp-100b) hd6432264rw(a ** )t f 100-pin tqfp (tfp-100g) hd6432264rw(a ** )f a 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432264rw(f ** )t e 100-pin tqfp (tfp-100b) hd6432264rw(f ** )t f 100-pin tqfp (tfp-100g) masked- rom version version with on-chip i 2 c bus interface hd6432264 rw hd6432264rw(f ** )f a 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd64f2264rte13 100-pin tqfp (tfp-100b) hd64f2264rtf13 100-pin tqfp (tfp-100g) hd64f2264rfa13 100-pin qfp (fp-100b) 3.0 v to 5.5 v hd64f2264rte20 100-pin tqfp (tfp-100b) hd64f2264rtf20 100-pin tqfp (tfp-100g) h8s/2264r (oscillation stabilization time shortened) f-ztat version standard product hd64f2264 r hd64f2264rfa20 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 640 of 658 product type product code mark code package (hitachi package code) operating voltage hd6432262w(a ** )te 100-pin tqfp (tfp-100b) hd6432262w(a ** )tf 100-pin tqfp (tfp-100g) hd6432262w(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432262w(f ** )te 100-pin tqfp (tfp-100b) hd6432262w(f ** )tf 100-pin tqfp (tfp-100g) h8s/2264r (regular oscillation) masked- rom version version with on-chip i 2 c bus interface hd6432262 w hd6432262w(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v hd6432262r(a ** )te 100-pin tqfp (tfp-100b) hd6432262r(a ** )tf 100-pin tqfp (tfp-100g) hd6432262r(a ** )fa 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432262r(f ** )te 100-pin tqfp (tfp-100b) hd6432262r(f ** )tf 100-pin tqfp (tfp-100g) h8s/2262r (oscillation stabilization time shortened) masked- rom version standard product hd6432262 r hd6432262r(f ** )fa 100-pin qfp (fp-100b) 4.0 v to 5.5 v
rev. 2.0, 09/02, page 641 of 658 product type product code mark code package (hitachi package code) operating voltage hd6432262rw(a ** )t e 100-pin tqfp (tfp-100b) hd6432262rw(a ** )t f 100-pin tqfp (tfp-100g) hd6432262rw(a ** )f a 100-pin qfp (fp-100b) 2.7 v to 5.5 v hd6432262rw(f ** )t e 100-pin tqfp (tfp-100b) hd6432262rw(f ** )t f 100-pin tqfp (tfp-100g) h8s/2262r (oscillation stabilization time shortened) masked- rom version version with on-chip i 2 c bus interface hd6432262 rw hd6432262rw(f ** )f a 100-pin qfp (fp-100b) 4.0 v to 5.5 v legend (a ** ), (f ** ): rom code note: some products above are in the developing or planning stage. please contact hitachi agency to conform the present state of each product.
rev. 2.0, 09/02, page 642 of 658 appendix c package dimensions figures c.1, c.2, and c.3 show the package dimensions of the h8s/2268 series and h8s/2264 series. hitachi code jedec jeita mass (reference value) tfp-100b ? conforms 0.5 g * dimension including the plating thickness base material dimension 16.0 0.2 14 0.08 0.10 0.5 0.1 16.0 0.2 0.5 0.10 0.10 1.20 max * 0.17 0.05 0? ? 8? 75 51 125 76 100 26 50 m * 0.22 0.05 1.0 1.00 1.0 0.20 0.04 0.15 0.04 as of january,2002 unit: mm figure c.1 tfp-100b package dimensions
rev. 2.0, 09/02, page 643 of 658 hitachi code jedec jeita mass (reference value) tfp-100g ? conforms 0.4 g * dimension including the plating thickness base material dimension 14.0 0.2 12 0.07 0.10 0.5 0.1 14.0 0.2 0.4 1.20 max * 0.17 0.05 0 ? ? 8 ? 75 51 125 76 100 26 50 m * 0.18 0.05 1.0 1.2 0.16 0.04 0.15 0.04 1.00 0.10 0.10 as of january,2002 unit: mm figure c.2 tfp-100g package dimensions
rev. 2.0, 09/02, page 644 of 658 hitachi code jedec jeita mass (reference value) fp-100b ? conforms 1.2 g * dimension including the plating thickness base material dimension 0.10 16.0 0.3 1.0 0.5 0.2 16.0 0.3 3.05 max 75 51 50 26 1 25 76 100 14 0 ? ? 8 ? 0.5 0.08 m * 0.22 0.05 2.70 * 0.17 0.05 0.12 +0.13 ? 0.12 1.0 0.20 0.04 0.15 0.04 as of january,2002 unit: mm figure c.3 fp-100b package dimensions
rev. 2.0, 09/02, page 645 of 658 main revisions and additions in this edition item page revisions (see manual for details) all in this version, descriptions of the h8s/2264 series are added. therefore, notes indicating the series name are added if there are differences in the specifications between the h8s/2268 series and h8s/2264 series. the added notes are as follows: (h8s/2268), (h8s/2268 series), (h8s/2268 series only), supported only by the h8s/2268 series, (h8s/2264), (h8s/2264 series), (h8s/2264 series only), or supported only by the h8s/2264 series. (error) (correction) h8s/2268 series: model rom ram model rom ram hd64f2268 256 kbytes 16 kbytes hd64f2268 256 kbytes 16 kbytes hd6432268 256 kbytes 16 kbytes hd64f2266 128 kbytes 8 kbytes hd6432268w 256 kbytes 16 kbytes hd64f2265 128 kbytes 8 kbytes hd6432268d 256 kbytes 16 kbytes hd6432268 256 kbytes 16 kbytes hd6432266 128 kbytes 8 kbytes hd6432268w 256 kbytes 16 kbytes hd6432266w 128 kbytes 8 kbytes hd6432266 128 kbytes 8 kbytes hd6432266d 128 kbytes 8 kbytes hd6432266w 128 kbytes 8 kbytes hd6432265 128 kbytes 4 kbytes hd6432265 128 kbytes 4 kbytes hd6432265w 128 kbytes 4 kbytes hd6432265w 128 kbytes 4 kbytes hd6432265d 128 kbytes 4 kbytes section 1 overview 1.1 overview ? on-chip memory figure 1.1 internal block diagram of h8s/2268 amended. description of (option) in dtmf deleted. bus line of port 9 amended. port 4 port 9 a/d converter(10 channels) d/a converter(2 channels) dtmf peripheral data bus peripheral address bus port h port j
rev. 2.0, 09/02, page 646 of 658 item page revisions (see manual for details) 9.1.4 pin functions p15/tiocb1/tclkc amended. (error) notes: 2. this pin functions as tclkd inputs when tpsc2 to tpsc0 in tcr0 or tcr2 are set to 110. (correction) notes: 2. this pin functions as tclk c inputs when tpsc2 to tpsc0 in tcr0 or tcr2 are set to 110. 9.2.4 port 3 open drain control register (p3odr) description of bits 5 to 0 amended. (error) when each of p35ddr and p34ddr bits is set to 1, the corresponding pins p35 and p34 function as open drain outputs. (correction) when each of p35 odr and p34 odr bits is set to 1, the corresponding pins p35 and p34 function as open drain outputs. amended. ph3/com4 x is amended to ? in table. 1 is amended to 0 in table. cmx ? 01 0 1 ? sups * ? ? ? 01 ? ? ph3ddr0101 ? 01 ? ? ? ph2/com3 and ph1/com2 x is amended to ? in table. cmx ? 01 ? ph2ddr0101 ? 9.7.4 pin functions amended. 111 counts on tcnt_2 overflow. (h8s/2268 series: setting disabled) table 10.6 tpsc0 to tpsc2 (channel 1)
rev. 2.0, 09/02, page 647 of 658 item page revisions (see manual for details) amended. capture input source is tioca0 pin input capture at rising edge input caputure register capture input source is tioca0 pin input capture at falling edge table 10.13 tiorh_0 (channel 0) (h8s/2268 series only) 10.3.6 timer counter (tcnt) amended. the tcnt counters are initialized to h'0000 by a reset, or in hardware standby mode. 11.9.2 input/output pins name in table amended. (error) timer clock input pin 4 (correction) timer clock input pin description of bits 6 to 4 amended. (error) these bits are always read as 0 and cannot be modified. (correction) the write value should always be 0. 13.3.10 serial expansion mode register (semr_0) description of bits 2 to 0 amended. the acs0 to acs0 settings are valid when the external clock input is selected (cke 1 in scr = 1) in asynchronous mode (c/ a in smr = 0). 000: external clock input : 111: 720 kbps average transfer rate (for = 6 mhz only) is selected (sci0 operates on base clock with frequency of 8 times transfer rate) 15.1 features amended. ? conversion time: 6.3 s per channel (at 20.5 mhz operation) 15.3.2 a/d control/status register (adcsr) description of bit 5 amended. a/d start ??? in scan mode, conversion continues sequentially on the specified channels until this bit is cleared to 0 by software, a reset, or a transition to power-down mode in which the a/d converter is halted, shown in table 22.1. figure 17.1 block diagram of lcd controller/driver amended. description of /8 to /1024 is amended to /16 to /2048.
rev. 2.0, 09/02, page 648 of 658 item page revisions (see manual for details) description of bits 7 and 3 amended. bit 7 r/w lcd disable bit this bit is always read as 1. the write value should always be 0. bit 3 r/w r/w r/w r/w frame frequency select 3 to 0 ??? in subactive mode, watch mode, and subsleep mode, the system clock ( ) is halted, and therefore display operations are not performed if one of the clocks from /16 to /2048 is selected. ??? 17.3.2 lcd control register (lcr) table 17.5 frame frequency selection values of operating clock and frame frequency amended. 17.3.3 lcd control register 2 (lcr2) description of bit 5 amended. (h8s/2268 series) triple step-up voltage circuit clock select this bit selects a clock used for triple step-up voltage circuit. this bit selects a clock which divides a clock specified by the lcd operating control register (lcr) by 4 or 8 as step-up voltage circuit clock. 0: a clock, which divides a lcd operating clock by 4, is selected as step-up voltage circuit clock 1: a clock, which divides a lcd operating clock by 8, is selected as step-up voltage circuit clock relationships between lcd operating clock and step-up voltage clock, and between bits cks3 to cks0 and bit hcks values of lcd clock, step-up voltage circuit clock, frame frequency, and step-up voltage circuit clock frequency amended. symbol of * is amended to x. 18.1 features amended. ? generating dtmf frequency sine waveform from the system clock ( ) the system clock (2.0 to 20.4 mhz, with 400 khz stops) figure 18.2 dtmf generation circuit diagram amended. description of 2.0 to 20.0 mhz is amended to 2.0 to 20.4 mhz.
rev. 2.0, 09/02, page 649 of 658 item page revisions (see manual for details) description of bits 5 to 0 amended. main clock division ratio 5 to 0 these bits set the system clock division ratio to produce 400- khz clock signals to be supplied to the dtmf generation circuit. the division ratio determines the counter value of 6b'000101 to 6b'11001 1(d'5 to d' 51) according to the range 2.0 to 20.4 mhz. 000000: setting prohibited : : 110010: division ratio (50) main clock frequency (20.0 mhz) 110011: division ratio (51) main clock frequency (20.4 mhz) 110100: setting prohibited : : 18.3.2 dtmf load register (dtlr) note amended. additionally, correct operation is not guaranteed if the dtl0 to dtl5 settings are other than 5 to 51 (division ratio 5 to 51). 18.4.2 operation flow amended. 1. set the system clock division ratio for the dtlr based on the frequency of the connected system clock. (2.0 to 20.4 mhz, with 400 khz stops) amended. 8 to 20.5 mhz 4 to 20.5 mhz 2 to 20.5 mhz table 20.5 system clock frequencies for which automatic adjustment of lsi bit rate is possible 20.11 programmer mode description amended. 20.13 flash memory programming and erasing precautions description of use the specified voltages and timing for programming and erasing amended. 22.1.1 standby control register (sbycr) description of bits 6 to 4 amended. 000: standby time = 8192 states : : 101: standby time = 262144 states 110: standby time = 2048 states 111: standby time = 16 states *
rev. 2.0, 09/02, page 650 of 658 item page revisions (see manual for details) figure 22.2 medium- speed mode transition and clearance timing amended. description of is amended to internal clock . amended. number of access states is amended from 2 to 1 in mra, sar, mrb, dar, cra, and crb. 25.1 register addresses (in address order) added. system clock control register 2 added. 25.3 register states in each operating mode amended. states of mra, sar, mrb, dar, cra, and crb are amended from initialized to ? . figure 26.1 power supply voltage and operating ranges (1) amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. values of f (mhz) in graphs (1) and (2) are amended from 20.0 to 20.5. figure 26.1 power supply voltage and operating ranges (2) amended. value of f (mhz) in graph (3) is amended from 20.0 to 20.5 and value of 10.0 is added. values of t (ns) in graphs (4) and (5) are amended from 50 to 48.8. value of t (ns) in graph (6) is amended from 50 to 48.8 and value of 100 is added. amended. description of ? preliminary ? deleted. table 26.2 dc characteristics (1) values of output high voltage, output low voltage, and input leakage current amended. amended. description of ? preliminary ? deleted. table 26.2 dc characteristics (2) values of output high voltage, output low voltage, and input leakage current amended. amended. description of ? preliminary ? deleted. values of current dissipation and analog power supply current amended. table 26.2 dc characteristics (3) values of reference current amended. notes 3 and 4 amended.
rev. 2.0, 09/02, page 651 of 658 item page revisions (see manual for details) table 26.2 dc characteristics (4) ? preliminary ? amended. notes 3 and 4 amended. amended. description of ? preliminary ? deleted. values of current dissipation, analog power supply current, and reference current amended. table 26.2 dc characteristics (5) notes 3 and 4 amended. amended. test condition of current dissipation is amended from f = 20 mhz to f = 20.5 mhz. table 26.2 dc characteristics (6) ? preliminary ? notes 3 and 4 amended. table 26.3 permissible output currents amended. value of total of port 7, 8 is amended from tbd to 30. amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. description of 20 mhz in condition c and d in table is amended to 20.5 mhz. table 26.5 clock timing values of condition c and d in clock cycle time are amended from min. 50 and max. 500 to min. 48.8 and max. 100. table 26.6 control signal timing amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. table 26.7 timing of on- chip peripheral modules item of transmit data delay time t txd is added to sci. table 26.8 i 2 c bus timing added. conditions of (regular specifications), ta = ? 40 c to + 80 c (wide-range specifications) added.
rev. 2.0, 09/02, page 652 of 658 item page revisions (see manual for details) amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. description of 20 mhz in condition c and d in table is amended to 20.5 mhz. table 26.9 a/d conversion characteristics in table: value of condition c and d in conversion time is amended from min. 6.5 to min. 6.3. value of condition c and d in nonlinearity error is amended from max. 6.0 to max. 3.0. value of condition c and d in offset error is amended from max. 4.0 to max. 2.0. value of condition c and d in full-scale error is amended from max. 4.0 to max. 2.0. value of condition c and d in absolute accuracy is amended from max. 8.0 to max. 4.0. table 26.10 d/a conversion characteristics amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. amended. description of 2 to 20 mhz in conditions c and d is amended to 10 to 20.5 mhz. table 26.11 lcd characteristics values of lcd power supply division resistor, lcd input reference voltage, lcd voltage, and lcd input reference power supply current amended. amended. conditions c and d description of av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 2 to 20 mhz is amended to av cc = 2.7 v to 5.5 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 10 to 20.4 mhz. table 26.12 dtmf characteristics values of dtmf output voltage (row side) and dtmf output voltage (column side) amended. note amended.
rev. 2.0, 09/02, page 653 of 658 item page revisions (see manual for details) table 26.13 flash memory characteristics amended. values of programming time, erase time, and count of rewriting amended. item of data hold time added. figure 26.5 oscillator settling timing amended. description of is amended to internal clock . figure 26.10 sck clock input timing amended. arrow which indicates range of t sckw amended.
rev. 2.0, 09/02, page 654 of 658
rev. 2.0, 09/02, page 655 of 658 index 16-bit timer pulse unit (tpu) .............. 171 buffer operation................................. 210 buffer operation timing .................... 230 counter operation............................... 203 free-running count operation.............. 204 input capture function ....................... 207 input capture signal timing .............. 228 output compare output timing......... 227 periodic count operation ..................... 204 phase counting mode......................... 220 pwm modes....................................... 215 synchronous operation....................... 208 tcnt count timing .......................... 227 toggle output ....................................... 206 waveform output by compare match 206 8-bit reload timer ................................. 265 automatic reload timer operation.... 270 interval timer operation .................... 269 8-bit timers............................................ 243 16-bit count mode ............................. 258 cascaded connection.......................... 258 compare-match count mode ............. 258 pulse output........................................ 254 tcnt incrementation timing ............ 255 toggle output...................................... 262 a/d converter ........................................ 411 a/d converter activation................... 226 analog input channel......................... 414 conversion time................................... 420 external trigger.................................... 422 scan mode .......................................... 419 single mode......................................... 418 address map............................................. 51 address space........................................... 20 addressing modes .................................... 40 absolute address.................................. 41 immediate ............................................. 42 memory indirect ................................... 42 program-counter relative ....................42 register direct ......................................41 register indirect....................................41 register indirect with displacement .....41 register indirect with post-increment ...41 register indirect with pre-decrement ....41 bcc ............................................................37 break address.............................................93 break condition ........................................95 bus arbitration........................................103 bus cycle..................................................101 bus masters.............................................103 clock pulse generator ............................507 condition field .........................................39 condition-code register...........................24 d/a converter.........................................429 data direction register (ddr)..................127 data register (dr)....................................127 data transfer controller .........................105 activated by software...........................121 block transfer mode.............................118 chain transfer.......................................119 dtc vector table...............................112 normal mode .......................................116 register information.............................112 repeat mode .........................................117 software activation ...................... 120, 125 vector number for the software activation interrupt...........................................111 dtmf generation circuit.......................457 effective address................................ 40, 43 effective address extension .....................39 exception handling...................................53 interrupts ...............................................57 reset exception handling.....................55
rev. 2.0, 09/02, page 656 of 658 stack status........................................... 59 traces.................................................... 57 trap instruction..................................... 58 exception vector table ............................ 54 extended control register........................ 23 flash memory .......................................... 467 boot mode ........................................... 484 emulation ............................................ 488 erase/erase-verify................................ 494 erasing units ........................................ 472 error protection ................................... 496 hardware protection ........................... 496 program/program-verify ..................... 492 software protection............................. 496 user program mode ............................. 487 general register ....................................... 26 i 2 c bus interface..................................... 367 i 2 c bus format..................................... 385 noise cancelers .................................... 398 serial format ........................................ 385 input pull-up mos function.................... 127 instruction set........................................... 29 arithmetic operations instructions....... 32 bit manipulation instructions ............... 35 block data transfer instructions .......... 39 branch instructions ............................... 37 data transfer instructions..................... 31 logic operations instructions............... 34 shift instructions................................... 34 system control instructions.................. 38 interrupt adi ..................................................... 422 cmia.................................................. 259 cmib .................................................. 259 eri...................................................... 359 nmi .................................................... 284 ovi ..................................................... 259 rxi ..................................................... 359 swdtend......................................... 120 tci...................................................... 225 tei ......................................................359 tgi......................................................225 txi......................................................359 wovi..................................................284 interrupt control modes............................82 interrupt controller ...................................61 interrupt exception handling vector table ..............................................................77 interrupt mask bit.....................................24 lcd controller/driver............................435 common drivers.................................439 duty cycle ..........................................435 lcd display .......................................446 lcd ram...........................................447 segment driver ...................................440 memory cycle..........................................101 on-board programming..........................484 operating mode selection.........................49 operation field .........................................39 pc break controller..................................93 power-down modes ...............................523 direct transitions................................541 hardware standby mode.....................536 medium-speed mode ...........................531 module stop mode..............................537 sleep mode .........................................532 software standby mode......................533 sub-active mode ................................540 sub-sleep mode..................................539 watch mode........................................538 power-on reset circuit power-on reset circuit..........................543 program counter .......................................23 program/erase protection........................496 programmer mode ..................................497 register adcr ......................... 417, 554, 561, 568 adcsr ....................... 415, 554, 561, 568
rev. 2.0, 09/02, page 657 of 658 addr ......................... 414, 553, 561, 568 bara ........................... 94, 550, 557, 565 barb ........................... 94, 550, 557, 565 bcra ........................... 95, 550, 557, 565 bcrb............................ 96, 550, 557, 565 brr ............................ 311, 553, 560, 567 cra ............................ 110, 548, 555, 563 crb ............................ 110, 548, 555, 563 dacr ......................... 431, 549, 556, 564 dadr ......................... 430, 549, 556, 564 dar............................ 109, 548, 555, 563 ddcswr ................... 385, 549, 556, 564 dtcer ....................... 110, 550, 558, 565 dtcr.......................... 459, 548, 555, 563 dtlr.......................... 460, 548, 555, 563 dtvecr .................... 111, 550, 558, 565 ebr1 .......................... 478, 554, 561, 568 ebr2 .......................... 480, 554, 561, 568 flmcr1..................... 477, 554, 561, 568 flmcr2..................... 478, 554, 561, 568 flpwcr .................... 482, 554, 561, 568 iccr........................... 378, 553, 560, 567 icdr........................... 371, 553, 560, 567 icmr .......................... 374, 553, 560, 567 icsr ........................... 382, 553, 560, 567 ienr1........................... 73, 549, 556, 564 ier................................ 68, 550, 558, 565 ipr ................................ 67, 551, 558, 565 iscr ............................. 69, 550, 558, 565 isr ................................ 71, 550, 558, 565 iwpr ............................ 73, 549, 556, 564 lcd ram .................. 447, 548, 555, 563 lcr ............................ 441, 548, 555, 563 lcr2 .......................... 442, 548, 555, 563 lpcr .......................... 438, 548, 555, 563 lpwrcr.................... 512, 550, 557, 565 mdcr........................... 50, 550, 557, 565 mra ........................... 107, 548, 555, 563 mrb ........................... 109, 548, 555, 563 mstpcr .................... 529, 557, 563, 565 p1ddr........................ 133, 550, 558, 565 p1dr .......................... 134, 551, 558, 566 p3ddr........................ 139, 550, 558, 565 p3dr........................... 139, 551, 558, 566 p3odr........................ 140, 551, 558, 565 p7ddr........................ 145, 551, 558, 565 p7dr........................... 145, 551, 558, 566 pfddr........................ 149, 551, 558, 565 pfdr........................... 149, 551, 558, 566 phddr ....................... 151, 548, 556, 563 phdr.......................... 152, 549, 556, 563 pjddr ........................ 157, 549, 556, 563 pjdr ........................... 157, 549, 556, 564 pjpcr ......................... 158, 549, 556, 564 pkddr ....................... 161, 549, 556, 563 pkdr.......................... 161, 549, 556, 564 plddr ....................... 163, 549, 556, 563 pldr .......................... 164, 549, 556, 564 pmddr ...................... 166, 549, 556, 563 pmdr ......................... 166, 549, 556, 564 pnddr ....................... 168, 549, 556, 563 pndr.......................... 168, 549, 556, 564 port1 ........................ 134, 554, 562, 568 port3 ........................ 140, 554, 562, 568 port4 ........................ 144, 554, 562, 568 port7 ........................ 146, 554, 562, 569 port9 ........................ 148, 554, 562, 569 portf ........................ 150, 554, 562, 569 porth ....................... 153, 549, 556, 564 portj......................... 158, 549, 556, 564 portk ....................... 162, 549, 556, 564 portl........................ 164, 549, 556, 564 portm....................... 167, 549, 556, 564 portn ....................... 169, 549, 556, 564 ramer ...................... 480, 551, 558, 566 rdr ............................ 294, 553, 560, 567 rsr .....................................................294 rstcsr...................... 280, 553, 560, 567 sar............................. 109, 548, 555, 563 sarx.......................... 373, 553, 560, 567 sbycr ....................... 527, 550, 557, 565 sckcr ....................... 509, 550, 557, 565 scmr ......................... 310, 553, 560, 567 scr ............................. 298, 553, 560, 567 scrx .......................... 377, 549, 556, 564 semr.......................... 319, 550, 557, 565
rev. 2.0, 09/02, page 658 of 658 smr............................ 295, 553, 560, 567 ssr ............................. 303, 553, 560, 567 syscr.......................... 65, 550, 557, 565 tcnt................. 199, 246, 268, 275, 551, 552, 559, 560, 566, 567 tcora....................... 246, 552, 560, 567 tcorb ....................... 246, 552, 560, 567 tcr ........................... 178, 247, 551, 552, 559, 560, 566, 567 tcsr .................. 249, 276, 552, 560, 567 tdr ............................ 294, 553, 560, 567 tgr ............................ 199, 551, 559, 566 tier ........................... 192, 551, 559, 566 tior........................... 184, 551, 559, 566 tmdr......................... 182, 551, 559, 566 tsr............................. 194, 551, 559, 566 tstr .......................... 199, 551, 558, 565 tsyr .......................... 201, 551, 558, 565 wpcr......................... 159, 549, 556, 564 register field............................................ 39 reset ......................................................... 55 serial communication interface (sci)....289 asynchronous mode ...........................323 bit rate ...............................................311 break...................................................361 clocked synchronous mode ...............340 framing error .......................................330 mark state ...........................................361 multiprocessor communication function ........................................................334 overrun error .......................................330 parity error ..........................................330 smart card ..............................................289 smart card interface ...............................348 stack pointer ..............................................22 the internal power step-down circuit.......545 watchdog timer .....................................273 interval timer mode ...........................282 overflow .............................................283 watchdog timer mode .......................281
h8s/2268 series, h8s/2264 series hardware manual publication date: 1st edition, april 2001 2nd edition, september 2002 published by: business operation division semiconductor & integrated circuits hitachi, ltd. edited by: technical documentation group hitachi kodaira semiconductor co., ltd. copyright ? hitachi, ltd., 2001. all rights reserved. printed in japan.


▲Up To Search▲   

 
Price & Availability of HD64F2266TF20

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X